I’d like to be able to log for debugging purpose from a package that could be either part of a web app or a command line application
Current I use
print('some text');
But I cannot control at runtime what is printed (DEBUG, INFO, …)
While I’m used to use java.util.logging.Logger in java, I could not find a way to use the Logger class in the logging package of dart, in either a web or command line application.
Logger logger = new Logger('test');
logger.info('some text');
The simple code above compiles fine but I cannot see any ouput in either the console of Dartium or the Output pane in the DartEditor.
Has anyone successfully used it (and see some text)?
In my Dart Bat-belt, I keep a function like this:
Then I’ll add it to a Logger, typically the root logger: