Package | ch.capi.utils.logging |
Class | public class Logger |
Inheritance | Logger Object |
See also
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
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 |
Method | Defined By | ||
---|---|---|---|
getStackTrace():Array
Retrieves the stack trace into an Array. | Logger | ||
replaceVars(text:String, ... args):String
Processes the variables replacement. | Logger |
logHandlers | property |
logHandlers:Array
[read-only]
Defines the log handlers. The array contains instances
of ILogHandler
.
public function get logHandlers():Array
See also
logLevel | property |
logLevel:int
[read-write]
Defines the log level of the Logger
.
public function get logLevel():int
public function set logLevel(value:int):void
name | property |
name:String
[read-only]
Defines the name of the Logger
.
public function get name():String
parent | property |
parent:Logger
[read-only]
Defines the parent Logger
.
public function get parent():Logger
Logger | () | Constructor |
public function Logger(name:String, parent:Logger = null, logLevel:int = 0, ... defaultHandlers)
Creates a new Logger
object.
name:String — The parent Logger .
| |
parent:Logger (default = null )
| |
logLevel:int (default = 0 )
| |
... defaultHandlers |
See also
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
.
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.
|
String — The text with the replaced vars.
|
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
GLOBAL | Constant |
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