topical media & game development
actionscript-example-LoggerDemo.ax
actionscript-example-LoggerDemo.ax
(swf
)
[ flash
]
flex
package {
import flash.display.Sprite;
import logger.*;
public class actionscript-example-LoggerDemo extends Sprite {
public function actionscript-example-LoggerDemo() {
// Create log and observers.
var log:Logger;
log = Logger.getLog();
var outputLogView:OutputPanelView;
outputLogView = new OutputPanelView(log);
log.addObserver(outputLogView);
// Test the log out.
log.fatal("This is a non-recoverable problem.");
log.error("This is a serious problem that may be recoverable.");
log.warn("This is something to look into, but probably isn't serious.");
log.info("This is a general bit of application information.");
// This won't appear because the log instance defaults
// to log level "INFO", which filters out debug messages.
log.debug("This is a note that helps track down a bug.");
// If we change the log level to "DEBUG"...
log.setLevel(Logger.DEBUG);
// ...then debug messages appear.
log.debug("Just testing!");
}
}
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.