-
Notifications
You must be signed in to change notification settings - Fork 8
Logging
Andreas Rønning edited this page Oct 17, 2013
·
1 revision
DConsole is tied into the SLF4AS logging framework. This framework allows you to create unique loggers for classes you want to output messages. The following example demonstrates its use.
private static const L:ILogger = Logging.getLogger(Tests);
//First, create a static logger object associated with this class
private function entrypoint():void{
//To log messages, we call specialized logging methods on the logger object
L.debug("Hello debug");
//These are general debugging messages (your commonplace traces)
L.info("Hello info");
//Slightly more important messages, for instance dealing with application status
L.warn("Hello warn");
//Something untowards has happened, but it's not critical
L.error("Hello error");
//Something bad has happened! But the application can still recover...
L.fatal("Hello fatal");
//Something REALLY BAD has happened. It's game over for your app.
// There are package level logging methods as well
debug("Hello debug");
}
Whenever a unique logger is used to print a message to the console, a tab is created along the top edge of the interface, letting you quickly filter out specific messages you're interested in. The various logging levels are also separately color coded.