| Package | system.logging.targets |
| Class | public class TraceTarget |
| Inheritance | TraceTarget LineFormattedTarget LoggerTarget Object |
Example :
package examples
{
import system.logging.Log;
import system.logging.Logger;
import system.logging.LoggerLevel;
import system.logging.targets.TraceTarget;
import flash.display.Sprite;
public class TraceTargetExample extends Sprite
{
public function TraceTargetExample()
{
// setup writer
var target:TraceTarget = new TraceTarget() ;
target.filters = [ "examples.*" ] ;
target.level = LoggerLevel.ALL ;
target.includeDate = true ;
target.includeTime = true ;
target.includeLevel = true ;
target.includeChannel = true ;
target.includeLines = true ;
var logger:Logger = Log.getLogger( "example" ) ;
logger.log ( "Here is some myDebug info : {0} and {1}", 2.25 , true ) ;
logger.debug ( "Here is some debug message." ) ;
logger.info ( "Here is some info message." ) ;
logger.warn ( "Here is some warn message." ) ;
logger.error ( "Here is some error message." ) ;
logger.fatal ( "Here is some fatal error..." ) ;
target.includeDate = false ;
target.includeTime = false ;
target.includeChannel = false ;
logger.info( "test : [{0}, {1}, {2}]", 2, 4, 6 ) ;
}
}
}
| Method | Defined By | ||
|---|---|---|---|
Creates a new TraceTarget instance. | TraceTarget | ||
![]() | addFilter(channel:String):Boolean
Insert a channel in the fllters if this channel don't exist. | LoggerTarget | |
![]() |
Sets up this target with the specified logger. | LoggerTarget | |
internalLog(message:*, level:LoggerLevel):void [override]
Descendants of this class should override this method to direct the specified message to the desired output. | TraceTarget | ||
![]() | logEntry(entry:LoggerEntry):void [override]
This method receive a LoggerEntry from an associated logger. | LineFormattedTarget | |
![]() | receive(... values):void
This method is called when the receiver is connected with a Signal object. | LoggerTarget | |
![]() | removeFilter(channel:String):Boolean
Remove a channel in the fllters if this channel exist. | LoggerTarget | |
![]() | removeLogger(logger:Logger):void
Stops this target from receiving events from the specified logger. | LoggerTarget | |
![]() | resetLineNumber():void
Resets the internal line number value (set to 1). | LineFormattedTarget | |
| TraceTarget | () | Constructor |
public function TraceTarget()Creates a new TraceTarget instance.
| internalLog | () | method |
override public function internalLog(message:*, level:LoggerLevel):voidDescendants of this class should override this method to direct the specified message to the desired output.
Parameters
message:* — String containing preprocessed log message which may include time, date, channel, etc.
based on property settings, such as includeDate, includeChannel, etc.
| |
level:LoggerLevel |