Packagecom.asfusion.mate.utils.debug
Classpublic class Logger
InheritanceLogger Inheritance flash.events.EventDispatcher
ImplementsIMateLogger

This class dispatches events for each message logged, allowing the debugger to listen to those events.



Public Properties
 PropertyDefined by
  active : Boolean
Flag that indicates if the logger is active or not
Logger
  category : String
The category this logger send messages for.
Logger
Public Methods
 MethodDefined by
  
Logger(active:Boolean = false)
Constructor
Logger
  
debug(msg:String, ... rest):void
Logs the specified data using the LogEventLevel.DEBUG level.
Logger
  
error(msg:String, ... rest):void
Logs the specified data using the LogEventLevel.ERROR level.
Logger
  
fatal(msg:String, ... rest):void
Logs the specified data using the LogEventLevel.FATAL level.
Logger
  
info(msg:String, ... rest):void
Logs the specified data using the LogEvent.INFO level.
Logger
  
isActive():Boolean
Function that returns the active status
Logger
  
log(level:int, msg:String, ... rest):void
Logs the specified data at the given level.
Logger
  
warn(msg:String, ... rest):void
Logs the specified data using the LogEventLevel.WARN level.
Logger
Protected Methods
 MethodDefined by
  
dispatch(message:String, level:int, parameters:Array):void
Dispatches a MateLogEvent for each message logged.
Logger
  
dispatchError(message:String, level:int, parameters:Array):void
Dispatches all errors even when the setting active is false.
Logger
Property detail
activeproperty
active:Boolean  [read-write]

Flag that indicates if the logger is active or not

Implementation
    public function get active():Boolean
    public function set active(value:Boolean):void
categoryproperty 
category:String  [read-write]

The category this logger send messages for.

Implementation
    public function get category():String
    public function set category(value:String):void
Constructor detail
Logger()constructor
public function Logger(active:Boolean = false)

Constructor

Parameters
active:Boolean (default = false)
Method detail
debug()method
public function debug(msg:String, ... rest):void

Logs the specified data using the LogEventLevel.DEBUG level. LogEventLevel.DEBUG designates informational level messages that are fine grained and most helpful when debugging an application.

The string specified for logging can contain braces with an index indicating which additional parameter should be inserted into the string before it is logged. For example "the first additional parameter was {0} the second was {1}" will be translated into "the first additional parameter was 10 the second was 15" when called with 10 and 15 as parameters.

Parameters
msg:String — The information to log. This string can contain special marker characters of the form {x}, where x is a zero based index that will be replaced with the additional parameters found at that index if specified.
 
... rest — Additional parameters that can be subsituted in the str parameter at each "{x}" location, where x is an integer (zero based) index value into the Array of values specified.

Example
       // Get the logger for the mx.messaging.Channel "category"
       // and send some data to it.
       var logger:ILogger = Log.getLogger("mx.messaging.Channel");
       logger.debug("here is some channel info {0} and {1}", 15.4, true);
             // This will log the following String:
       //   "here is some channel info 15.4 and true"
       

dispatch()method 
protected function dispatch(message:String, level:int, parameters:Array):void

Dispatches a MateLogEvent for each message logged.

Parameters
message:String
 
level:int
 
parameters:Array
dispatchError()method 
protected function dispatchError(message:String, level:int, parameters:Array):void

Dispatches all errors even when the setting active is false.

Parameters
message:String
 
level:int
 
parameters:Array
error()method 
public function error(msg:String, ... rest):void

Logs the specified data using the LogEventLevel.ERROR level. LogEventLevel.ERROR designates error events that might still allow the application to continue running.

The string specified for logging can contain braces with an index indicating which additional parameter should be inserted into the string before it is logged. For example "the first additional parameter was {0} the second was {1}" will be translated into "the first additional parameter was 10 the second was 15" when called with 10 and 15 as parameters.

Parameters
msg:String — The information to log. This String can contain special marker characters of the form {x}, where x is a zero based index that will be replaced with the additional parameters found at that index if specified.
 
... rest — Additional parameters that can be subsituted in the str parameter at each "{x}" location, where x is an integer (zero based) index value into the Array of values specified.

Example
       // Get the logger for the mx.messaging.Channel "category"
       // and send some data to it.
       var logger:ILogger = Log.getLogger("mx.messaging.Channel");
       logger.error("here is some channel info {0} and {1}", 15.4, true);
             // This will log the following String:
       //   "here is some channel info 15.4 and true"
       

fatal()method 
public function fatal(msg:String, ... rest):void

Logs the specified data using the LogEventLevel.FATAL level. LogEventLevel.FATAL designates events that are very harmful and will eventually lead to application failure

The string specified for logging can contain braces with an index indicating which additional parameter should be inserted into the string before it is logged. For example "the first additional parameter was {0} the second was {1}" will be translated into "the first additional parameter was 10 the second was 15" when called with 10 and 15 as parameters.

Parameters
msg:String — The information to log. This String can contain special marker characters of the form {x}, where x is a zero based index that will be replaced with the additional parameters found at that index if specified.
 
... rest — Additional parameters that can be subsituted in the str parameter at each "{x}" location, where x is an integer (zero based) index value into the Array of values specified.

Example
       // Get the logger for the mx.messaging.Channel "category"
       // and send some data to it.
       var logger:ILogger = Log.getLogger("mx.messaging.Channel");
       logger.fatal("here is some channel info {0} and {1}", 15.4, true);
             // This will log the following String:
       //   "here is some channel info 15.4 and true"
       

info()method 
public function info(msg:String, ... rest):void

Logs the specified data using the LogEvent.INFO level. LogEventLevel.INFO designates informational messages that highlight the progress of the application at coarse-grained level.

The string specified for logging can contain braces with an index indicating which additional parameter should be inserted into the string before it is logged. For example "the first additional parameter was {0} the second was {1}" will be translated into "the first additional parameter was 10 the second was 15" when called with 10 and 15 as parameters.

Parameters
msg:String — The information to log. This String can contain special marker characters of the form {x}, where x is a zero based index that will be replaced with the additional parameters found at that index if specified.
 
... rest — Additional parameters that can be subsituted in the str parameter at each "{x}" location, where x is an integer (zero based) index value into the Array of values specified.

Example
       // Get the logger for the mx.messaging.Channel "category"
       // and send some data to it.
       var logger:ILogger = Log.getLogger("mx.messaging.Channel");
       logger.info("here is some channel info {0} and {1}", 15.4, true);
             // This will log the following String:
       //   "here is some channel info 15.4 and true"
       

isActive()method 
public function isActive():Boolean

Function that returns the active status

Returns
Boolean
log()method 
public function log(level:int, msg:String, ... rest):void

Logs the specified data at the given level.

The String specified for logging can contain braces with an index indicating which additional parameter should be inserted into the String before it is logged. For example "the first additional parameter was {0} the second was {1}" is translated into "the first additional parameter was 10 the second was 15" when called with 10 and 15 as parameters.

Parameters
level:int — The level this information should be logged at. Valid values are:
  • LogEventLevel.FATAL designates events that are very harmful and will eventually lead to application failure
  • LogEventLevel.ERROR designates error events that might still allow the application to continue running.
  • LogEventLevel.WARN designates events that could be harmful to the application operation
  • LogEventLevel.INFO designates informational messages that highlight the progress of the application at coarse-grained level.
  • LogEventLevel.DEBUG designates informational level messages that are fine grained and most helpful when debugging an application.
  • LogEventLevel.ALL intended to force a target to process all messages.
 
msg:String — The information to log. This String can contain special marker characters of the form {x}, where x is a zero based index that will be replaced with the additional parameters found at that index if specified.
 
... rest — Additional parameters that can be subsituted in the str parameter at each "{x}" location, where x is an integer (zero based) index value into the Array of values specified.

Example
       // Get the logger for the mx.messaging.Channel "category"
       // and send some data to it.
       var logger:ILogger = Log.getLogger("mx.messaging.Channel");
       logger.log(LogEventLevel.DEBUG, "here is some channel info {0} and {1}", LogEventLevel.DEBUG, 15.4, true);
             // This will log the following String as a DEBUG log message:
       //   "here is some channel info 15.4 and true"
       

warn()method 
public function warn(msg:String, ... rest):void

Logs the specified data using the LogEventLevel.WARN level. LogEventLevel.WARN designates events that could be harmful to the application operation.

The string specified for logging can contain braces with an index indicating which additional parameter should be inserted into the string before it is logged. For example "the first additional parameter was {0} the second was {1}" will be translated into "the first additional parameter was 10 the second was 15" when called with 10 and 15 as parameters.

Parameters
msg:String — The information to log. This String can contain special marker characters of the form {x}, where x is a zero based index that will be replaced with the additional parameters found at that index if specified.
 
... rest — Aadditional parameters that can be subsituted in the str parameter at each "{x}" location, where x is an integer (zero based) index value into the Array of values specified.

Example
       // Get the logger for the mx.messaging.Channel "category"
       // and send some data to it.
       var logger:ILogger = Log.getLogger("mx.messaging.Channel");
       logger.warn("here is some channel info {0} and {1}", 15.4, true);
             // This will log the following String:
       //   "here is some channel info 15.4 and true"