Packageorg.as3commons.logging.integration
Classpublic final class FlexLogger
InheritanceFlexLogger Inheritance mx.logging.AbstractTarget
Implements mx.logging.ILoggingTarget

Since : 2

The FlexLogger implements Flex's ILoggingTarget and allows this way to route the events sent to Flex's system straight to the as3commons system.

If you want to switch from the Flex's logging system to the as3commons logging system you can either change all references to from Flex to as3commons or use this FlexLogger in the mx.commons setup.

        mx.logging.Log.addTarget( new org.as3commons.logging.FlexLogger() );
        
        mx.logging.Log.getLogger( "MyClass" ).debug( "Hello World" );
        // is now routed to
        org.as3commons.logging.getLogger( "MyClass" ).debug( "Hello World" );
     



Public Methods
 MethodDefined By
  
FlexLogger(level:int = 2)
Constructs the FlexLogger instance.
FlexLogger
  
addLogger(logger:ILogger):void
[override] Stores a logger from the mx.commons system.
FlexLogger
  
logEvent(event:LogEvent):void
[override] Routes the log events to the as3commons equivalent.
FlexLogger
Constructor Detail
FlexLogger()Constructor
public function FlexLogger(level:int = 2)

Constructs the FlexLogger instance.

Parameters
level:int (default = 2) — Level to which the targets should be applied.
Method Detail
addLogger()method
override public function addLogger(logger:ILogger):void

Stores a logger from the mx.commons system.

Parameters

logger:ILoggerILogger to be stored.

logEvent()method 
override public function logEvent(event:LogEvent):void

Routes the log events to the as3commons equivalent.

Parameters

event:LogEvent — Event triggered by the flex event system.