Packagevegas.logging.targets
Classpublic class TraceTarget
InheritanceTraceTarget Inheritance LineFormattedTarget Inheritance AbstractTarget Inheritance CoreEventDispatcher Inheritance CoreObject

Provides a logger target that uses the global trace() method to output log messages.


Example
   import vegas.logging.ILogger ;
   import vegas.logging.ITarget ;
   import vegas.logging.Log ;
   import vegas.logging.LogEvent ;
   import vegas.logging.LogEventLevel ;
   import vegas.logging.targets.TraceTarget ;
   
   // setup writer 
   var traceTarget:TraceTarget = new TraceTarget() ;
   
   traceTarget.filters = ["myApplication"] ;
   traceTarget.includeDate = true ;
   traceTarget.includeTime = true ;
   traceTarget.includeLevel = true ;
   traceTarget.includeCategory = true ;
   traceTarget.includeLines = true ;
   traceTarget.level = LogEventLevel.ALL ; // LogEventLevel.DEBUG (only the debug logs).
   
   // start writing log data 
   Log.addTarget(traceTarget); 
   
   // get a logger for the 'myDebug' category 
   // and send some data to it.
   
   var logger:ILogger = Log.getLogger("myApplication") ;
   logger.log(LogEventLevel.DEBUG, "here is some myDebug info : {0} and {1}", 2.25 , true) ; 
   logger.fatal("Here is some fatal error...") ; 
   
   traceTarget.includeDate = false ;
   traceTarget.includeTime = false ;
   traceTarget.includeCategory = false ;
   logger.info("[{0}, {1}, {2}]", 2, 4, 6) ; 
   



Public Properties
 PropertyDefined by
 Inheritedchannel : String
Indicates the channel of this dispatcher if this instance is global.
CoreEventDispatcher
 InheritedcharPlacement : String = "'*' must be the right most character."
[static] The static field used when throws an Error when the character placement failed.
AbstractTarget
 InheritedcharsInvalid : String = "The following characters are not valid: []~$^&/(){}<>+=_-`!@#%?,:;'\"
[static] The static field used when throws an Error when a character is invalid.
AbstractTarget
 InheritederrorFilter : String = "Error for filter ''{0}'"
[static] The static field used when throws an Error when filter failed.
AbstractTarget
 Inheritedfilters : Array
(read-write) Returns the filters array representation of this target.
AbstractTarget
 InheritedincludeCategory : Boolean = false
Indicates if the category for this target should added to the trace.
LineFormattedTarget
 InheritedincludeDate : Boolean = false
Indicates if the date should be added to the trace.
LineFormattedTarget
 InheritedincludeLevel : Boolean = false
Indicates if the level for the event should added to the trace.
LineFormattedTarget
 InheritedincludeLines : Boolean = false
Indicates if the line for the event should added to the trace.
LineFormattedTarget
 InheritedincludeMilliseconds : Boolean = false
Indicates if the milliseconds should be added to the trace.
LineFormattedTarget
 InheritedincludeTime : Boolean = false
Indicates if the time should be added to the trace.
LineFormattedTarget
 InheritedisGlobal : Boolean
(read-only) Returns the value of the isGlobal flag of this model.
CoreEventDispatcher
 Inheritedlevel : LogEventLevel
(read-write) Returns the level of this target.
AbstractTarget
 Inheritedseparator : String = " "
The separator string.
LineFormattedTarget
Public Methods
 MethodDefined by
  
Creates a new TraceTarget instance.
TraceTarget
 Inherited
addCategory(category:String):Boolean
Insert a category in the fllters if this category don't exist.
AbstractTarget
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target.
CoreEventDispatcher
 Inherited
addLogger(logger:ILogger):void
Sets up this target with the specified logger.
AbstractTarget
 Inherited
addNamespace(nameSpace:String):Boolean
Add a new namespace in the filters array.
AbstractTarget
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
CoreEventDispatcher
 Inherited
Returns the internal EventDispatcher reference.
CoreEventDispatcher
 Inherited
getIsGlobal():Boolean
Returns the value of the isGlobal flag of this model.
CoreEventDispatcher
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
CoreEventDispatcher
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
 Inherited
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor).
CoreEventDispatcher
  
internalLog(message:*, level:LogEventLevel):void
Descendants of this class should override this method to direct the specified message to the desired output.
TraceTarget
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreEventDispatcher
 Inherited
lock():void
Locks the object.
CoreEventDispatcher
 Inherited
logEvent(event:LogEvent):void
This method handles a LogEvent from an associated logger.
LineFormattedTarget
 Inherited
registerEventListener(type:String, listener:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = false):void
Allows the registration of event listeners on the event target (Function or EventListener).
CoreEventDispatcher
 Inherited
removeCategory(category:String):Boolean
Remove a category in the fllters if this category exist.
AbstractTarget
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
CoreEventDispatcher
 Inherited
removeLogger(logger:ILogger):void
Stops this target from receiving events from the specified logger.
AbstractTarget
 Inherited
removeNamespace(nameSpace:String):Boolean
Removes an existing namespace in the filters array.
AbstractTarget
 Inherited
Sets the internal EventDispatcher reference.
CoreEventDispatcher
 Inherited
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
CoreEventDispatcher
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
CoreEventDispatcher
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
 Inherited
unlock():void
Unlocks the display.
CoreEventDispatcher
 Inherited
unregisterEventListener(type:String, listener:Boolean, useCapture:* = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
CoreEventDispatcher
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
CoreEventDispatcher
Protected Methods
 MethodDefined by
 Inherited
formatDate(d:Date):String
This method format the passed Date in arguments.
LineFormattedTarget
 Inherited
formatLevel(level:String):String
This method format the passed level in arguments.
LineFormattedTarget
 Inherited
formatLines():String
This method format the current line value.
LineFormattedTarget
 Inherited
formatMessage(message:*, level:String, category:String, date:Date):String
This method format the log message.
LineFormattedTarget
 Inherited
formatTime(d:Date):String
This method format the current Date passed in argument.
LineFormattedTarget
 Inherited
getDigit(n:Number):String
Returns the string representation of a number and use digit conversion.
LineFormattedTarget
Constructor detail
TraceTarget()constructor
public function TraceTarget()

Creates a new TraceTarget instance.

Method detail
internalLog()method
public override function internalLog(message:*, level:LogEventLevel):void

Descendants 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, category, etc. based on property settings, such as includeDate, includeCategory, etc.
 
level:LogEventLevel