Packagech.capi.utils.logging
Classpublic class Logger
InheritanceLogger Inheritance Object

Manages the logging.

See also

ILogHandler


Public Properties
 PropertyDefined By
  logHandlers : Array
[read-only] Defines the log handlers.
Logger
  logLevel : int
Defines the log level of the Logger.
Logger
  name : String
[read-only] Defines the name of the Logger.
Logger
  parent : Logger
[read-only] Defines the parent Logger.
Logger
Public Methods
 MethodDefined By
  
Logger(name:String, parent:Logger = null, logLevel:int = 0, ... defaultHandlers)
Creates a new Logger object.
Logger
  
config(text:String, ... args):void
Logs a message at the level LogLevel.CONFIG.
Logger
  
fine(text:String, ... args):void
Logs a message at the level LogLevel.FINE.
Logger
  
finer(text:String, ... args):void
Logs a message at the level LogLevel.FINER.
Logger
  
finest(text:String, ... args):void
Logs a message at the level LogLevel.FINEST.
Logger
  
info(text:String, ... args):void
Logs a message at the level LogLevel.INFO.
Logger
  
log(level:int, text:String, ... args):void
Log the text with the specified text only if the current log level is lower or equal that the specified level.
Logger
  
severe(text:String, ... args):void
Logs a message at the level LogLevel.SEVERE.
Logger
  
warning(text:String, ... args):void
Logs a message at the level LogLevel.WARNING.
Logger
Protected Methods
 MethodDefined By
  
Retrieves the stack trace into an Array.
Logger
  
replaceVars(text:String, ... args):String
Processes the variables replacement.
Logger
Public Constants
 ConstantDefined By
  GLOBAL : Logger
[static] Defines the global Logger.
Logger
Property Detail
logHandlersproperty
logHandlers:Array  [read-only]

Defines the log handlers. The array contains instances of ILogHandler.


Implementation
    public function get logHandlers():Array

See also

logLevelproperty 
logLevel:int  [read-write]

Defines the log level of the Logger.


Implementation
    public function get logLevel():int
    public function set logLevel(value:int):void
nameproperty 
name:String  [read-only]

Defines the name of the Logger.


Implementation
    public function get name():String
parentproperty 
parent:Logger  [read-only]

Defines the parent Logger.


Implementation
    public function get parent():Logger
Constructor Detail
Logger()Constructor
public function Logger(name:String, parent:Logger = null, logLevel:int = 0, ... defaultHandlers)

Creates a new Logger object.

Parameters
name:String — The parent Logger.
 
parent:Logger (default = null)
 
logLevel:int (default = 0)
 
... defaultHandlers

See also

Method Detail
config()method
public function config(text:String, ... args):void

Logs a message at the level LogLevel.CONFIG.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

fine()method 
public function fine(text:String, ... args):void

Logs a message at the level LogLevel.FINE.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

finer()method 
public function finer(text:String, ... args):void

Logs a message at the level LogLevel.FINER.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

finest()method 
public function finest(text:String, ... args):void

Logs a message at the level LogLevel.FINEST.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

getStackTrace()method 
protected function getStackTrace():Array

Retrieves the stack trace into an Array. If the player is not a debug player, this method simply returns null.

The first line of the stack trace (the error message) is not into the returned Array.

Returns
Array — The stack trace in an Array or null.
info()method 
public function info(text:String, ... args):void

Logs a message at the level LogLevel.INFO.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

log()method 
public function log(level:int, text:String, ... args):void

Log the text with the specified text only if the current log level is lower or equal that the specified level. If the log can be processed, it is first sent to the parent and then to the handlers.

Parameters

level:int — The level of the log.
 
text:String — The text to log.
 
... args — The arguments of the text.

See also

replaceVars()method 
protected function replaceVars(text:String, ... args):String

Processes the variables replacement. A variable is denoted by a '?' followed with a index starting with 1. For the replace, the toString() method is called on each element of the args array.

Parameters

text:String — The text with variables.
 
... args — The arguments to replace into the text.

Returns
String — The text with the replaced vars.

Example
         var txt:String = replaceVars("Hello ?1, This is ?2 speaking", "Sarah", "Cedric");
         //Hello Sarah, This is Cedric speaking
         
severe()method 
public function severe(text:String, ... args):void

Logs a message at the level LogLevel.SEVERE.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

warning()method 
public function warning(text:String, ... args):void

Logs a message at the level LogLevel.WARNING.

Parameters

text:String — The text to log.
 
... args — The arguments of the text.

See also

Constant Detail
GLOBALConstant
public static const GLOBAL:Logger

Defines the global Logger. This Logger has no parent and a default handler which is a TraceHandler. By default, its level is LogLevel.INFO