topical media & game development

talk show tell print

actionscript-misc-LoggerDemo.ax

actionscript-misc-LoggerDemo.ax [swf] flex


  package {
          import flash.display.Sprite;
    //import logger.*;
  
          public class @ax-actionscript-misc-LoggerDemo extends Sprite {
                  public function @ax-actionscript-misc-LoggerDemo() {
  
        // Create log and observers.
        var log:actionscript_lib_logger_Logger;
        log = actionscript_lib_logger_Logger.getLog();
        var outputLogView:actionscript_lib_logger_OutputPanelView;
        outputLogView = new actionscript_lib_logger_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(actionscript_lib_logger_Logger.DEBUG);
  
        // ...then debug messages appear.
        log.debug("Just testing!");
                  }
          }
  }
  


(C) Æliens 27/08/2009

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.