Packagesystem.logging.targets
Classpublic class TextFieldTarget
InheritanceTextFieldTarget Inheritance LineFormattedTarget Inheritance LoggerTarget Inheritance Object

Provides a logger target that uses a TextField to output log messages.

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()
             {
                 ///////////
                 
                 var field:TextField = new TextField() ;
                 
                 field.x                 = 10 ;
                 field.y                 = 10 ;
                 field.width             = 700 ;
                 field.height            = 400 ;
                 field.defaultTextFormat = new TextFormat("Courier New", 11) ;
                 field.background        = true ;
                 field.backgroundColor   = 0xFFFFFF ;
                 field.border            = true ;
                 field.borderColor       = 0x999999 ;
                 field.multiline         = true ;
                 field.wordWrap          = true ;
                 
                 addChild( field ) ;
                 
                 ///////////
                 
                 var target:TextFieldTarget = new TextFieldTarget(field) ;
                 
                 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( "examples.TextFieldTarget" ) ;
                 
                 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 ) ;
             }
         }
     }
     



Public Properties
 PropertyDefined By
  autoScroll : Boolean = true
This boolean indicates if the TextField autoscroll when a new log message is append in the target (default is true).
TextFieldTarget
 Inheritedfactory : LoggerFactory
Determinates the LoggerFactory reference of the target, by default the target use the system.logging.Log singleton.
LoggerTarget
 Inheritedfilters : Array
Indicates the filters array representation of this target.
LoggerTarget
 InheritedincludeChannel : Boolean
Indicates if the channel for this target should added to the trace.
LineFormattedTarget
 InheritedincludeDate : Boolean
Indicates if the date should be added to the trace.
LineFormattedTarget
 InheritedincludeLevel : Boolean
Indicates if the level for the event should added to the trace.
LineFormattedTarget
 InheritedincludeLines : Boolean
Indicates if the line for the event should added to the trace.
LineFormattedTarget
 InheritedincludeMilliseconds : Boolean
Indicates if the milliseconds should be added to the trace.
LineFormattedTarget
 InheritedincludeTime : Boolean
Indicates if the time should be added to the trace.
LineFormattedTarget
 Inheritedlevel : LoggerLevel
Indicates the level of this target.
LoggerTarget
 Inheritedseparator : String =
The separator string.
LineFormattedTarget
  textfield : TextField
The TextField reference of this target.
TextFieldTarget
Public Methods
 MethodDefined By
  
TextFieldTarget(textfield:TextField)
Creates a new TextFieldTarget instance.
TextFieldTarget
 Inherited
addFilter(channel:String):Boolean
Insert a channel in the fllters if this channel don't exist.
LoggerTarget
 Inherited
addLogger(logger:Logger):void
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.
TextFieldTarget
 Inherited
logEntry(entry:LoggerEntry):void
[override] This method receive a LoggerEntry from an associated logger.
LineFormattedTarget
 Inherited
receive(... values):void
This method is called when the receiver is connected with a Signal object.
LoggerTarget
 Inherited
removeFilter(channel:String):Boolean
Remove a channel in the fllters if this channel exist.
LoggerTarget
 Inherited
removeLogger(logger:Logger):void
Stops this target from receiving events from the specified logger.
LoggerTarget
 Inherited
Resets the internal line number value (set to 1).
LineFormattedTarget
Property Detail
autoScrollproperty
public var autoScroll:Boolean = true

This boolean indicates if the TextField autoscroll when a new log message is append in the target (default is true).

textfieldproperty 
public var textfield:TextField

The TextField reference of this target.

Constructor Detail
TextFieldTarget()Constructor
public function TextFieldTarget(textfield:TextField)

Creates a new TextFieldTarget instance.

Parameters
textfield:TextField — The TextField reference to output the log messages.
Method Detail
internalLog()method
override public function internalLog(message:*, level:LoggerLevel):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:LoggerLevel


Throws
ReferenceError — If the internal textfield reference is null.