Packagesystem.logging.targets
Classpublic class SOSTarget
InheritanceSOSTarget Inheritance SocketTarget Inheritance LineFormattedTarget Inheritance LoggerTarget Inheritance Object

Provides a logger target that uses the SOS Max console to output log messages. Thanks PowerFlasher and the free SOS Max Console



Public Properties
 PropertyDefined By
  ALL_COLOR : Number = 0xE6E6E6
[static] Provides the color in the SOS console to display all levels.
SOSTarget
 Inheritedconnected : Boolean
[read-only] Indicates if the target is connected with Socket server.
SocketTarget
  DEBUG_COLOR : Number = 0xDEECFE
[static] Provides the 'debug' color in the SOS console.
SOSTarget
  DEFAULT_COLOR : Number = 0xFFFFFF
[static] Provides the 'default' color in the SOS console.
SOSTarget
  ERROR_COLOR : Number = 0xEDCC81
[static] Provides the 'error' color in the SOS console.
SOSTarget
 Inheritedfactory : LoggerFactory
Determinates the LoggerFactory reference of the target, by default the target use the system.logging.Log singleton.
LoggerTarget
  FATAL_COLOR : Number = 0xFDD1B5
[static] Provides the 'fatal' color in the SOS console.
SOSTarget
 Inheritedfilters : Array
Indicates the filters array representation of this target.
LoggerTarget
 Inheritedhost : String
The host of the socket connection.
SocketTarget
 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
  INFO_COLOR : Number = 0xD2FAB8
[static] Provides the 'info' color in the SOS console.
SOSTarget
 Inheritedlevel : LoggerLevel
Indicates the level of this target.
LoggerTarget
  LEVEL_COLOR : String = !SOS{0}{1}
[static] Provided the "setLabelColor" pattern.
SOSTarget
  levelPolicy : Boolean = true
Defines the level colors policy in the message sending to the SOS console.
SOSTarget
 Inheritedport : int
The port of the socket connection.
SocketTarget
 Inheritedseparator : String =
The separator string.
LineFormattedTarget
  WARN_COLOR : Number = 0xFDFDB5
[static] Provides the 'warn' color in the SOS console.
SOSTarget
  WTF_COLOR : Number = 0xE2355B
[static] Provides the 'wtf' color in the SOS console.
SOSTarget
Public Methods
 MethodDefined By
  
SOSTarget(name:String = null, color:Number, idenfify:Boolean = true, host:String = localhost, port:int = 4444, auto:Boolean = true)
Creates a new SOSTarget instance.
SOSTarget
 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
  
clear():void
Clear the console.
SOSTarget
 Inherited
close():void
Closes the target socket connection.
SocketTarget
 Inherited
connect():void
Connects the target with the socket server.
SocketTarget
 Inherited
flush():void
Flush the target with all caching messages.
SocketTarget
  
identify():void
Shows some Information about the Connection.
SOSTarget
  
internalLog(message:*, level:LoggerLevel):void
[override] Descendants of this class should override this method to direct the specified message to the desired output.
SOSTarget
 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
 Inherited
send(message:*):void
Send message or bufferize message if the socket is not connected yet.
SocketTarget
  
sendFoldLevelMessage(title:String, message:String, level:LoggerLevel):void
Send a fold message with a specific level.
SOSTarget
  
sendLevelMessage(message:String, level:LoggerLevel):void
Send a message with a specific level.
SOSTarget
  
setApplicationColor(color:Number):void
Sets the color of the application, the Color must be set as Integer Value.
SOSTarget
  
setApplicationName(name:String):void
Sets the name of the application in the SOS console.
SOSTarget
  
setLevelColor(level:LoggerLevel, color:Number):void
Sets the color for a specific level.
SOSTarget
Public Constants
 ConstantDefined By
  APPLICATION_COLOR : String = !SOS{0}
[static] Provides the message pattern to send in the SOS console the application color.
SOSTarget
  APPLICATION_NAME : String = !SOS{0}
[static] Provides the message pattern to send in the SOS console the application name.
SOSTarget
  CLEAR : String = !SOS
[static] Provides the message to send in the SOS console to clear the console.
SOSTarget
  IDENTIFY : String = !SOS
[static] Provides the message to send in the SOS console to identify the application.
SOSTarget
  SHOW_FOLD_MESSAGE : String = !SOS<![CDATA[{1}]]>
[static] Provides the message pattern to send in the SOS console the "showFoldMessage" expression.
SOSTarget
  SHOW_MESSAGE : String = !SOS
[static] Provides the message pattern to send in the SOS console the "showMessage" expression.
SOSTarget
Property Detail
ALL_COLORproperty
public static var ALL_COLOR:Number = 0xE6E6E6

Provides the color in the SOS console to display all levels.

DEBUG_COLORproperty 
public static var DEBUG_COLOR:Number = 0xDEECFE

Provides the 'debug' color in the SOS console.

DEFAULT_COLORproperty 
public static var DEFAULT_COLOR:Number = 0xFFFFFF

Provides the 'default' color in the SOS console.

ERROR_COLORproperty 
public static var ERROR_COLOR:Number = 0xEDCC81

Provides the 'error' color in the SOS console.

FATAL_COLORproperty 
public static var FATAL_COLOR:Number = 0xFDD1B5

Provides the 'fatal' color in the SOS console.

INFO_COLORproperty 
public static var INFO_COLOR:Number = 0xD2FAB8

Provides the 'info' color in the SOS console.

LEVEL_COLORproperty 
public static var LEVEL_COLOR:String = !SOS{0}{1}

Provided the "setLabelColor" pattern.

levelPolicyproperty 
public var levelPolicy:Boolean = true

Defines the level colors policy in the message sending to the SOS console.

WARN_COLORproperty 
public static var WARN_COLOR:Number = 0xFDFDB5

Provides the 'warn' color in the SOS console.

WTF_COLORproperty 
public static var WTF_COLOR:Number = 0xE2355B

Provides the 'wtf' color in the SOS console.

Constructor Detail
SOSTarget()Constructor
public function SOSTarget(name:String = null, color:Number, idenfify:Boolean = true, host:String = localhost, port:int = 4444, auto:Boolean = true)

Creates a new SOSTarget instance.

Parameters
name:String (default = null) — The host of the socket connection (default "localhost").
 
color:Number (default = NaN) — The port of the socket connection (default 4444).
 
idenfify:Boolean (default = true) — Indicates if the target is auto connected with the server.
 
host:String (default = localhost)
 
port:int (default = 4444)
 
auto:Boolean (default = true)
Method Detail
clear()method
public function clear():void

Clear the console.

identify()method 
public function identify():void

Shows some Information about the Connection. This time it is : HostName, HostAddress and Color.

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 — the LogEventLevel of the message.

sendFoldLevelMessage()method 
public function sendFoldLevelMessage(title:String, message:String, level:LoggerLevel):void

Send a fold message with a specific level.

Parameters

title:String
 
message:String
 
level:LoggerLevel

sendLevelMessage()method 
public function sendLevelMessage(message:String, level:LoggerLevel):void

Send a message with a specific level.

Parameters

message:String
 
level:LoggerLevel

setApplicationColor()method 
public function setApplicationColor(color:Number):void

Sets the color of the application, the Color must be set as Integer Value. So 16768477 equals 0xffdddd.

Parameters

color:Number

setApplicationName()method 
public function setApplicationName(name:String):void

Sets the name of the application in the SOS console.

Parameters

name:String

setLevelColor()method 
public function setLevelColor(level:LoggerLevel, color:Number):void

Sets the color for a specific level. If the color argument is NaN, the default color of the passed-in LoggerLevel is used.

Parameters

level:LoggerLevel
 
color:Number (default = NaN)

See also

LogEventLevel
Constant Detail
APPLICATION_COLORConstant
public static const APPLICATION_COLOR:String = !SOS{0}

Provides the message pattern to send in the SOS console the application color.

APPLICATION_NAMEConstant 
public static const APPLICATION_NAME:String = !SOS{0}

Provides the message pattern to send in the SOS console the application name.

CLEARConstant 
public static const CLEAR:String = !SOS

Provides the message to send in the SOS console to clear the console.

IDENTIFYConstant 
public static const IDENTIFY:String = !SOS

Provides the message to send in the SOS console to identify the application.

SHOW_FOLD_MESSAGEConstant 
public static const SHOW_FOLD_MESSAGE:String = !SOS<![CDATA[{1}]]>

Provides the message pattern to send in the SOS console the "showFoldMessage" expression.

SHOW_MESSAGEConstant 
public static const SHOW_MESSAGE:String = !SOS

Provides the message pattern to send in the SOS console the "showMessage" expression.