| Package | vegas.logging.targets |
| Class | public class SOSTarget |
| Inheritance | SOSTarget LineFormattedTarget AbstractTarget CoreEventDispatcher CoreObject |
Example :
import vegas.logging.ILogger ;
import vegas.logging.Log ;
import vegas.logging.targets.SOSTarget ;
// setup target
var target:SOSTarget = new SOSTarget("myApplication", 0xD8F394) ;
target.filters = [ "myApplication" ] ; // use a empty array to receive all logs.
target.includeLines = true ;
target.includeCategory = true ;
target.includeDate = true ;
target.includeTime = true ;
target.includeLevel = true ;
target.level = LogEventLevel.ALL ;
//target.setLevelColor(LogEventLevel.DEBUG, 0xFF0000) ;
//target.levelPolicy = SOSType.DISABLE ; // SOSType.ENABLE default value
target.sendFoldLevelMessage( LogEventLevel.DEBUG, "Init SOS console", "test a fold message" ) ;
target.sendMessage("Init SOS console....") ;
// register target
Log.addTarget(target);
// create a log writer
var logger:ILogger = Log.getLogger("myApplication") ;
logger.log(LogEventLevel.DEBUG, "here is some myDebug info : {0} and {1}", 2.25 , true) ;
logger.debug("DEBUG !!") ;
logger.error("ERROR !!") ;
logger.fatal("FATAL !!") ;
logger.info("INFO !!") ;
logger.warn("WARNING !!") ;
logger.warn([3, 2, 4]) ;
| Property | Defined by | ||
|---|---|---|---|
| ALL_COLOR : Number = 0xD7EEFD [static]
Provides the color in the SOS console to display all levels.
| SOSTarget | ||
![]() | channel : String
Indicates the channel of this dispatcher if this instance is global.
| CoreEventDispatcher | |
![]() | charPlacement : String = "'*' must be the right most character." [static]
The static field used when throws an Error when the character placement failed.
| AbstractTarget | |
![]() | charsInvalid : String = "The following characters are not valid: []~$^&/(){}<>+=_-`!@#%?,:;'\" [static]
The static field used when throws an Error when a character is invalid.
| AbstractTarget | |
| connected : Boolean [read-only]
Returns 'true' if your application is connected with SOS Console.
| SOSTarget | ||
| 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 | ||
![]() | errorFilter : String = "Error for filter ''{0}'" [static]
The static field used when throws an Error when filter failed.
| AbstractTarget | |
| FATAL_COLOR : Number = 0xFDD1B5 [static]
Provides the 'fatal' color in the SOS console.
| SOSTarget | ||
![]() | filters : Array
(read-write) Returns the filters array representation of this target.
| AbstractTarget | |
| HOST : String = "localhost" [static]
Provides the default host in the SOS console to connect the internal XMLSocket.
| SOSTarget | ||
![]() | includeCategory : Boolean = false
Indicates if the category for this target should added to the trace.
| LineFormattedTarget | |
![]() | includeDate : Boolean = false
Indicates if the date should be added to the trace.
| LineFormattedTarget | |
![]() | includeLevel : Boolean = false
Indicates if the level for the event should added to the trace.
| LineFormattedTarget | |
![]() | includeLines : Boolean = false
Indicates if the line for the event should added to the trace.
| LineFormattedTarget | |
![]() | includeMilliseconds : Boolean = false
Indicates if the milliseconds should be added to the trace.
| LineFormattedTarget | |
![]() | includeTime : Boolean = false
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 | ||
![]() | isGlobal : Boolean
(read-only) Returns the value of the isGlobal flag of this model.
| CoreEventDispatcher | |
![]() | level : LogEventLevel
(read-write) Returns the level of this target.
| AbstractTarget | |
| levelPolicy : Number
Show the level colors.
| SOSTarget | ||
| PORT : Number = 4444 [static]
Provides the default port in the SOS console to connect the internal XMLSocket.
| SOSTarget | ||
![]() | separator : String = " "
The separator string.
| LineFormattedTarget | |
| WARN_COLOR : Number = 0xFDFDB5 [static]
Provides the 'warn' color in the SOS console.
| SOSTarget | ||
| Method | Defined by | ||
|---|---|---|---|
|
SOSTarget(name:String = null, color:Number, isIdenfify:Boolean = true)
Creates a new SOSTarget instance.
| SOSTarget | ||
![]() |
addCategory(category:String):Boolean
Insert a category in the fllters if this category don't exist.
| AbstractTarget | |
![]() |
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 | |
![]() |
Sets up this target with the specified logger.
| AbstractTarget | |
![]() |
addNamespace(nameSpace:String):Boolean
Add a new namespace in the filters array.
| AbstractTarget | |
|
clear():void
Clear the console.
| SOSTarget | ||
|
close():void
Close the console socket connection.
| SOSTarget | ||
|
connect():void
Connect to the SOS console.
| SOSTarget | ||
![]() |
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
| CoreEventDispatcher | |
|
exit():void
Exit and close the SOS console.
| SOSTarget | ||
![]() |
Returns the internal
EventDispatcher reference. | CoreEventDispatcher | |
|
getFoldMessage(title:String, message:String, level:LogEventLevel):String
Returns the string socket representation to send a fold message in the SOSConsole.
| SOSTarget | ||
![]() |
getIsGlobal():Boolean
Returns the value of the isGlobal flag of this model.
| CoreEventDispatcher | |
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
| CoreEventDispatcher | |
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreObject | |
|
identify():void
Shows some Information about the Connection.
| SOSTarget | ||
![]() |
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.
| SOSTarget | ||
![]() |
isLocked():Boolean
Returns
true if the object is locked. | CoreEventDispatcher | |
![]() |
lock():void
Locks the object.
| CoreEventDispatcher | |
![]() |
This method handles a
LogEvent from an associated logger. | LineFormattedTarget | |
![]() |
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 | |
![]() |
removeCategory(category:String):Boolean
Remove a category in the fllters if this category exist.
| AbstractTarget | |
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
| CoreEventDispatcher | |
![]() |
removeLogger(logger:ILogger):void
Stops this target from receiving events from the specified logger.
| AbstractTarget | |
![]() |
removeNamespace(nameSpace:String):Boolean
Removes an existing namespace in the filters array.
| AbstractTarget | |
|
sendFoldLevelMessage(level:LogEventLevel, title:String, message:String):void
Send a fold message with a specific level.
| SOSTarget | ||
|
sendLevelMessage(level:LogEventLevel, message:String):void
Send a message with a specific level.
| SOSTarget | ||
|
sendMessage(msg:String):void
Send message or bufferize message if the SOS console is disconnected.
| SOSTarget | ||
|
setAppColor(color:Number):void
Sets the color of the application, the Color must be set as Integer Value.
| SOSTarget | ||
|
setAppName(name:String):void
Sets the name of the application.
| SOSTarget | ||
![]() |
setEventDispatcher(e:EventDispatcher):void
Sets the internal
EventDispatcher reference. | CoreEventDispatcher | |
![]() |
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 | |
|
setLevelColor(level:LogEventLevel, color:Number):void
Sets the color for a specific level.
| SOSTarget | ||
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
| CoreEventDispatcher | |
![]() |
toString():String
Returns the string representation of this instance.
| CoreObject | |
![]() |
unlock():void
Unlocks the display.
| CoreEventDispatcher | |
![]() |
unregisterEventListener(type:String, listener:Boolean, useCapture:* = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
| CoreEventDispatcher | |
![]() |
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 | |
| Method | Defined by | ||
|---|---|---|---|
|
flush():void
Flush the target.
| SOSTarget | ||
![]() |
formatDate(d:Date):String
This method format the passed Date in arguments.
| LineFormattedTarget | |
![]() |
formatLevel(level:String):String
This method format the passed level in arguments.
| LineFormattedTarget | |
![]() |
formatLines():String
This method format the current line value.
| LineFormattedTarget | |
![]() |
formatMessage(message:*, level:String, category:String, date:Date):String
This method format the log message.
| LineFormattedTarget | |
![]() |
formatTime(d:Date):String
This method format the current Date passed in argument.
| LineFormattedTarget | |
![]() |
getDigit(n:Number):String
Returns the string representation of a number and use digit conversion.
| LineFormattedTarget | |
| Constant | Defined by | ||
|---|---|---|---|
| CLEAR : String = "!SOS<clear/>
" [static]
Provides the message to send in the SOS console to clear the console.
| SOSTarget | ||
| DISABLE : Number = 0 [static]
Provides the value if you want 'disabled' the levels colors in the SOS Console.
| SOSTarget | ||
| ENABLE : Number = 1 [static]
Provides the value if you want 'enabled' the levels colors in the SOS Console.
| SOSTarget | ||
| EXIT : String = "!SOS<exit/>" [static]
Provides the message to send in the SOS console to exit the console.
| SOSTarget | ||
| ALL_COLOR | property |
public static var ALL_COLOR:Number = 0xD7EEFDProvides the color in the SOS console to display all levels.
| connected | property |
connected:Boolean [read-only]Returns 'true' if your application is connected with SOS Console.
Implementation public function get connected():Boolean
| DEBUG_COLOR | property |
public static var DEBUG_COLOR:Number = 0xDEECFEProvides the 'debug' color in the SOS console.
| DEFAULT_COLOR | property |
public static var DEFAULT_COLOR:Number = 0xFFFFFFProvides the 'default' color in the SOS console.
| ERROR_COLOR | property |
public static var ERROR_COLOR:Number = 0xEDCC81Provides the 'error' color in the SOS console.
| FATAL_COLOR | property |
public static var FATAL_COLOR:Number = 0xFDD1B5Provides the 'fatal' color in the SOS console.
| HOST | property |
public static var HOST:String = "localhost"Provides the default host in the SOS console to connect the internal XMLSocket.
| INFO_COLOR | property |
public static var INFO_COLOR:Number = 0xD2FAB8Provides the 'info' color in the SOS console.
| levelPolicy | property |
public var levelPolicy:NumberShow the level colors. Use SOSType.ENABLE or SOSType.DISABLE
| PORT | property |
public static var PORT:Number = 4444Provides the default port in the SOS console to connect the internal XMLSocket.
| WARN_COLOR | property |
public static var WARN_COLOR:Number = 0xFDFDB5Provides the 'warn' color in the SOS console.
| SOSTarget | () | constructor |
public function SOSTarget(name:String = null, color:Number, isIdenfify:Boolean = true)Creates a new SOSTarget instance.
Parametersname:String (default = null) — The name of the target application in the console.
|
|
color:Number — The color of the application in the console.
|
|
isIdenfify:Boolean (default = true) — Inficates if the target is identify or not.
|
| clear | () | method |
public function clear():voidClear the console.
| close | () | method |
public function close():voidClose the console socket connection.
| connect | () | method |
public function connect():voidConnect to the SOS console.
| exit | () | method |
public function exit():voidExit and close the SOS console.
| flush | () | method |
protected function flush():voidFlush the target.
| getFoldMessage | () | method |
public function getFoldMessage(title:String, message:String, level:LogEventLevel):StringReturns the string socket representation to send a fold message in the SOSConsole.
Parameterstitle:String |
|
message:String |
|
level:LogEventLevel |
String — the string socket representation to send a fold message in the SOSConsole.
|
| identify | () | method |
public function identify():voidShows some Information about the Connection. This time it is : HostName, HostAddress and Color.
| internalLog | () | method |
public override function internalLog(message:*, level:LogEventLevel):voidDescendants of this class should override this method to direct the specified message to the desired output.
Parametersmessage:* — String containing preprocessed log message which may include time, date, category, etc. based on property settings, such as includeDate, includeCategory, etc.
|
|
level:LogEventLevel — the LogEventLevel of the message.
|
| sendFoldLevelMessage | () | method |
public function sendFoldLevelMessage(level:LogEventLevel, title:String, message:String):voidSend a fold message with a specific level.
Parameterslevel:LogEventLevel |
|
title:String |
|
message:String |
| sendLevelMessage | () | method |
public function sendLevelMessage(level:LogEventLevel, message:String):voidSend a message with a specific level.
Parameterslevel:LogEventLevel |
|
message:String |
| sendMessage | () | method |
public function sendMessage(msg:String):voidSend message or bufferize message if the SOS console is disconnected.
Parametersmsg:String |
| setAppColor | () | method |
public function setAppColor(color:Number):voidSets the color of the application, the Color must be set as Integer Value. So 16768477 equals 0xffdddd.
Parameterscolor:Number |
| setAppName | () | method |
public function setAppName(name:String):voidSets the name of the application.
Parametersname:String |
| setLevelColor | () | method |
public function setLevelColor(level:LogEventLevel, color:Number):voidSets the color for a specific level.
Parameterslevel:LogEventLevel |
|
color:Number |
See also
| CLEAR | constant |
public static const CLEAR:String = "!SOS<clear/>
"Provides the message to send in the SOS console to clear the console.
| DISABLE | constant |
public static const DISABLE:Number = 0Provides the value if you want 'disabled' the levels colors in the SOS Console.
| ENABLE | constant |
public static const ENABLE:Number = 1Provides the value if you want 'enabled' the levels colors in the SOS Console.
| EXIT | constant |
public static const EXIT:String = "!SOS<exit/>"Provides the message to send in the SOS console to exit the console.