| Package | system.logging.targets |
| Class | public class TextFieldTarget |
| Inheritance | TextFieldTarget 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()
{
///////////
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 ) ;
}
}
}
| Property | Defined 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 | ||
![]() | factory : LoggerFactory
Determinates the LoggerFactory reference of the target, by default the target use the system.logging.Log singleton. | LoggerTarget | |
![]() | filters : Array
Indicates the filters array representation of this target. | LoggerTarget | |
![]() | includeChannel : Boolean
Indicates if the channel for this target should added to the trace. | LineFormattedTarget | |
![]() | includeDate : Boolean
Indicates if the date should be added to the trace. | LineFormattedTarget | |
![]() | includeLevel : Boolean
Indicates if the level for the event should added to the trace. | LineFormattedTarget | |
![]() | includeLines : Boolean
Indicates if the line for the event should added to the trace. | LineFormattedTarget | |
![]() | includeMilliseconds : Boolean
Indicates if the milliseconds should be added to the trace. | LineFormattedTarget | |
![]() | includeTime : Boolean
Indicates if the time should be added to the trace. | LineFormattedTarget | |
![]() | level : LoggerLevel
Indicates the level of this target. | LoggerTarget | |
![]() | separator : String =
The separator string. | LineFormattedTarget | |
| textfield : TextField
The TextField reference of this target. | TextFieldTarget | ||
| Method | Defined By | ||
|---|---|---|---|
TextFieldTarget(textfield:TextField)
Creates a new TextFieldTarget instance. | TextFieldTarget | ||
![]() | 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. | TextFieldTarget | ||
![]() | 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 | |
| autoScroll | property |
public var autoScroll:Boolean = trueThis boolean indicates if the TextField autoscroll when a new log message is append in the target (default is true).
| textfield | property |
public var textfield:TextFieldThe TextField reference of this target.
| TextFieldTarget | () | Constructor |
public function TextFieldTarget(textfield:TextField)Creates a new TextFieldTarget instance.
Parameterstextfield:TextField — The TextField reference to output the log messages.
|
| 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, category, etc.
based on property settings, such as includeDate, includeCategory, etc.
| |
level:LoggerLevel |
ReferenceError — If the internal textfield reference is null.
|