Posts

Showing posts with the label Console

Console.log In Dart Language

Answer : Simple: print('This will be logged to the console in the browser.'); A basic top-level print function is always available in all implementations of Dart (browser, VM, etc.). Because Dart has string interpolation, it's easy to use that to print useful stuff too: var a = 123; var b = new Point(2, 3); print('a is $a, b is ${b.x}, ${b.y}'); Also, dart:html allows use of window.console object. import 'dart:html'; void main() { window.console.debug("debug message"); window.console.info("info message"); window.console.error("error message"); } It’s easy! Just import the logging package: import 'package:logging/logging.dart'; Create a logger object: final _logger = Logger('YourClassName'); Then in your code when you need to log something: _logger.info('Request received!'); If you catch an exception you can log it and the stacktrace as well. _logger.severe('Oops, an error occurred', er...

Console/Terminal Widget For Qt?

Answer : QConsole used to do something like that. (Not sure the project is active anymore, but you might want to have a look). Found some decent source code here. Very basic functionality, but I've been adding to it some and I think it has promise to do what I need it to. NOTE: I have only tested this code in Win32. Here is a link to my new question concerning this code.

Alternative Console Host For Windows 7/Windows Server 2008

Answer : Below are some nice console-replacements products that are more user-friendly than cmd. As commented below, since Windows 7, all these shells are just an interface to conhost.exe, even powershell. For details, read What is conhost.exe and Why Is It Running. Therefore, the consoles below only replace the default visual interface to conhost which is the one exhibited by cmd, and are only useful when directly invoked as programs. They cannot be indirectly invoked, as when a console-executable such as diskpart is run, since this will invoke conhost, and conhost has its own I/O interface and API. Here is what Microsoft says in Windows 7 / Windows Server 2008 R2: Console Host : ConHost represents a permanent change in the way that console application I/O is handled. There is no registry key or group policy setting that can force Windows to revert back to “legacy mode” console behavior. The conclusion is that if you wish to replace the console in a deeper way t...