gugga.logging.Logger Class Reference

List of all members.

Detailed Description

Definition at line 19 of file Logger.as.

Public Member Functions

function getParent ()
function getName ()
function finest (message:String)
function finer (message:String)
function fine (message:String)
function info (message:String)
function warning (message:String)
function severe (message:String)
function log (level:Level, message:String)
function setLevel (level:Level)
function getLevel ()
function setFilter (filter:IFilter)
function getFilter ()
function addPublisher (publisher:IPublisher)
function removePublisher (publisher:IPublisher)
function getPublishers ()
function isLoggable (level:Level)

Static Public Member Functions

static function getLogger (name:String)
static function getLoggerFor (aObject:Object)
static function logFinest (message:String, aContextObject:Object)
static function logFiner (message:String, aContextObject:Object)
static function logFine (message:String, aContextObject:Object)
static function logInfo (message:String, aContextObject:Object)
static function logWarning (message:String, aContextObject:Object)
static function logSevere (message:String, aContextObject:Object)
static function logMessage (level:Level, message:String, aContextObject:Object)

Private Member Functions

function Logger (name:String)
function getEffectiveLevel ()
function getActivePublishers ()
function isPublishable (logRecord:LogRecord)

Static Private Member Functions

static function getLoggerMap ()

Private Attributes

var name:String
var level:Level
var filter:IFilter
var publishers:ArrayList

Static Private Attributes

static var OBJECT_DEFAULT_LOGGER_VAR_NAME: String = "___default_logger"
static var loggerMap:Object


Constructor & Destructor Documentation

function gugga.logging.Logger.Logger ( name:String   )  [private]

Private constructor. Use factory method to create logger objects only.

Parameters:
name the logger name

Definition at line 34 of file Logger.as.


Member Function Documentation

static function gugga.logging.Logger.getLogger ( name:String   )  [static]

Find or create a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise a new logger is created. If a new logger is created its log level will be configured based on the LogManager configuration and it will configured to also send logging output to its parent's publishers.

Parameters:
name A name for the logger, or nothing for anonymous loggers. A name should be a dot-separated name and should normally be based on the package name or class name of the subsystem, such as mx.core or mx.controls
Returns:
A suitable logger.

Definition at line 48 of file Logger.as.

static function gugga.logging.Logger.getLoggerFor ( aObject:Object   )  [static]

Definition at line 59 of file Logger.as.

static function gugga.logging.Logger.logFinest ( message:String  ,
aContextObject:Object   
) [static]

Definition at line 73 of file Logger.as.

static function gugga.logging.Logger.logFiner ( message:String  ,
aContextObject:Object   
) [static]

Definition at line 78 of file Logger.as.

static function gugga.logging.Logger.logFine ( message:String  ,
aContextObject:Object   
) [static]

Definition at line 83 of file Logger.as.

static function gugga.logging.Logger.logInfo ( message:String  ,
aContextObject:Object   
) [static]

Definition at line 88 of file Logger.as.

static function gugga.logging.Logger.logWarning ( message:String  ,
aContextObject:Object   
) [static]

Definition at line 93 of file Logger.as.

static function gugga.logging.Logger.logSevere ( message:String  ,
aContextObject:Object   
) [static]

Definition at line 98 of file Logger.as.

static function gugga.logging.Logger.logMessage ( level:Level  ,
message:String  ,
aContextObject:Object   
) [static]

Definition at line 103 of file Logger.as.

static function gugga.logging.Logger.getLoggerMap (  )  [static, private]

Returns the Logger Map where all loggers are kept. If the map does not yet exist, a new one will be created.

Returns:
A map object

Definition at line 114 of file Logger.as.

function gugga.logging.Logger.getParent (  ) 

Return the parent for this Logger.

This method returns the nearest extant parent in the namespace. Thus if a Logger is called "a.b.c.d", and a Logger called "a.b" has been created but no logger "a.b.c" exists, then a call of getParent on the Logger "a.b.c.d" will return the Logger "a.b".

The parent for the anonymous Logger is always the root (global) Logger.

The result will be undefined if it is called on the root (global) Logger in the namespace.

Returns:
A logger object or undefined

Definition at line 134 of file Logger.as.

function gugga.logging.Logger.getName (  ) 

Get the name for this logger.

Returns:
The logger's name or undefined for anonymous loggers.

Definition at line 160 of file Logger.as.

function gugga.logging.Logger.finest ( message:String   ) 

Log a FINEST message. If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered publishers.

Parameters:
message A string message

Definition at line 171 of file Logger.as.

function gugga.logging.Logger.finer ( message:String   ) 

Log a FINER message. If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered publishers.

Parameters:
message A string message

Definition at line 182 of file Logger.as.

function gugga.logging.Logger.fine ( message:String   ) 

Log a FINE message. If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered publishers.

Parameters:
message A string message

Definition at line 193 of file Logger.as.

function gugga.logging.Logger.info ( message:String   ) 

Log a INFO message. If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered publishers.

Parameters:
message A string message

Definition at line 204 of file Logger.as.

function gugga.logging.Logger.warning ( message:String   ) 

Log a WARNING message. If the logger is currently enabled for the WARNING message level then the given message is forwarded to all the registered publishers.

Parameters:
message A string message

Definition at line 215 of file Logger.as.

function gugga.logging.Logger.severe ( message:String   ) 

Log a SEVERE message. If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered publishers.

Parameters:
message A string message

Definition at line 226 of file Logger.as.

function gugga.logging.Logger.log ( level:Level  ,
message:String   
)

Log a message. If the logger is currently enabled for the given message level then the given message is forwarded to all the registered publishers.

Parameters:
level The level object
message The string message

Definition at line 238 of file Logger.as.

function gugga.logging.Logger.setLevel ( level:Level   ) 

Set the log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded. The level value Level.OFF can be used to turn off logging. If the new level is undefined, it means that this node should inherit its level from its nearest ancestor with a specific (non-undefined) level value.

Parameters:
The new level or undefined.

Definition at line 261 of file Logger.as.

function gugga.logging.Logger.getLevel (  ) 

Get the log Level that has been specified for this Logger. The result may be undefined, which means that this logger's effective level will be inherited from its parent.

Returns:
The level object for this logger or undefined.

Definition at line 272 of file Logger.as.

function gugga.logging.Logger.getEffectiveLevel (  )  [private]

Get the effective log Level for this logger. The result will be Level.ALL if the inherited level from its parent is undefined.

Returns:
The effective level object for this logger.

Definition at line 283 of file Logger.as.

function gugga.logging.Logger.setFilter ( filter:IFilter   ) 

Set a filter to control output on this Logger. After passing the initial "level" check, the Logger will call this Filter to check if a log record should really be published.

Parameters:
A filter object

Definition at line 304 of file Logger.as.

function gugga.logging.Logger.getFilter (  ) 

Get the current filter for this Logger.

Returns:
A filter object or undefined.

Definition at line 314 of file Logger.as.

function gugga.logging.Logger.addPublisher ( publisher:IPublisher   ) 

Adds a publisher for this logger to receive logging messages. By default, Loggers also send their output to their parent logger.

Parameters:
A new publisher object.

Definition at line 325 of file Logger.as.

function gugga.logging.Logger.removePublisher ( publisher:IPublisher   ) 

Removes a publisher currently associated with this logger.

Parameters:
A publisher object.

Definition at line 337 of file Logger.as.

function gugga.logging.Logger.getPublishers (  ) 

Gets a list with Publishers currently associated with this logger.

Returns:
A list with publishers (may be empty)

Definition at line 347 of file Logger.as.

function gugga.logging.Logger.getActivePublishers (  )  [private]

Gets a list with Publishers including the parent's loggers publishers.

Returns:
A list with publishers (may be empty)

Definition at line 357 of file Logger.as.

function gugga.logging.Logger.isLoggable ( level:Level   ) 

Check if a message of the given level would actually be logged by this logger. This check is based on the Loggers effective level, which may be inherited from its parent.

Parameters:
level The level to be checked
Returns:
true if the given message is currently being logged

Definition at line 382 of file Logger.as.

function gugga.logging.Logger.isPublishable ( logRecord:LogRecord   )  [private]

Check if a log record would actually be published by this logger, after it had passed the cheap level check through isLoggable This private convenience method basically checks if the log record would pass the filter.

Parameters:
the LogRecord to be checked
Returns:
true if publishable, otherwise false

Definition at line 399 of file Logger.as.


Member Data Documentation

var gugga.logging.Logger.OBJECT_DEFAULT_LOGGER_VAR_NAME [static, private]

Definition at line 21 of file Logger.as.

var gugga.logging.Logger.loggerMap [static, private]

Definition at line 23 of file Logger.as.

var gugga.logging.Logger.name [private]

Definition at line 24 of file Logger.as.

var gugga.logging.Logger.level [private]

Definition at line 25 of file Logger.as.

var gugga.logging.Logger.filter [private]

Definition at line 26 of file Logger.as.

var gugga.logging.Logger.publishers [private]

Definition at line 27 of file Logger.as.


Generated on Fri May 11 17:14:14 2007 for GuggaFramework by  doxygen 1.5.2