Packageorg.as3commons.logging.api
Classpublic final class Logger
InheritanceLogger Inheritance Object
Implements ILogger

Proxy for an ILogger implementation. This class is used by the LoggerFactory in the setup process.

A Logger instance is created for each logger requested from the factory. The Logger instances do get augmented by ILogSetup in the setup process.

See also

org.as3commons.logging.api.ILogSetup


Public Properties
 PropertyDefined By
  allTargets : ILogTarget
[write-only] Sets all loggers to the passed-in logTarget.
Logger
  debugEnabled : Boolean
[read-only] true if debug actually does something.
Logger
  debugTarget : ILogTarget
The logger for debug level, if not added (== null) debug is not enabled.
Logger
  errorEnabled : Boolean
[read-only] true if error actually does something.
Logger
  errorTarget : ILogTarget
The logger for error level, if not added (== null) error is not enabled.
Logger
  fatalEnabled : Boolean
[read-only] true if fatal works.
Logger
  fatalTarget : ILogTarget
The logger for fatal level, if not added (== null) fatal is not enabled.
Logger
  infoEnabled : Boolean
[read-only] true if info actually does something.
Logger
  infoTarget : ILogTarget
The logger for debug level, if not added (== null) info is not enabled.
Logger
  name : String
[read-only] Getter for the name this instance.
Logger
  person : String
[read-only] Returns the person that this logger created.
Logger
  shortName : String
[read-only] Returns the short form of the name.
Logger
  warnEnabled : Boolean
[read-only] true if warn actually does something.
Logger
  warnTarget : ILogTarget
The logger for warn level, if not added (== null) warn is not enabled.
Logger
Public Methods
 MethodDefined By
  
Logger(name:String, person:String = null)
Creates a new Logger Proxy.
Logger
  
debug(message:*, parameters:Array = null):void
Logs a message for debug purposes.
Logger
  
error(message:*, parameters:Array = null):void
Logs a message to notify about an error that was dodged by the application.
Logger
  
fatal(message:*, parameters:Array = null):void
Logs a message to notify about an error that broke the application and couldn't be fixed automatically.
Logger
  
info(message:*, parameters:Array = null):void
Logs a message for notification purposes.
Logger
  
toString():String
String representation of the Logger.
Logger
  
warn(message:*, parameters:Array = null):void
Logs a message for warning about a undesirable application state.
Logger
Property Detail
allTargetsproperty
allTargets:ILogTarget  [write-only]

Sets all loggers to the passed-in logTarget.


Implementation
    public function set allTargets(value:ILogTarget):void
debugEnabledproperty 
debugEnabled:Boolean  [read-only]

true if debug actually does something.


Implementation
    public function get debugEnabled():Boolean
debugTargetproperty 
public var debugTarget:ILogTarget

The logger for debug level, if not added (== null) debug is not enabled.

errorEnabledproperty 
errorEnabled:Boolean  [read-only]

true if error actually does something.


Implementation
    public function get errorEnabled():Boolean
errorTargetproperty 
public var errorTarget:ILogTarget

The logger for error level, if not added (== null) error is not enabled.

fatalEnabledproperty 
fatalEnabled:Boolean  [read-only]

true if fatal works.


Implementation
    public function get fatalEnabled():Boolean
fatalTargetproperty 
public var fatalTarget:ILogTarget

The logger for fatal level, if not added (== null) fatal is not enabled.

infoEnabledproperty 
infoEnabled:Boolean  [read-only]

true if info actually does something.


Implementation
    public function get infoEnabled():Boolean
infoTargetproperty 
public var infoTarget:ILogTarget

The logger for debug level, if not added (== null) info is not enabled.

nameproperty 
name:String  [read-only]

Getter for the name this instance.


Implementation
    public function get name():String
personproperty 
person:String  [read-only]

Returns the person that this logger created.

For person based log statements loggers contain a optional information that can be used to filter for persons that created the logggers


Implementation
    public function get person():String
shortNameproperty 
shortName:String  [read-only]

Returns the short form of the name.

The name of a ILogger is usually [package].[class]. The short name contains only the name of [class], in other words: the content after the last ".".


Implementation
    public function get shortName():String
warnEnabledproperty 
warnEnabled:Boolean  [read-only]

true if warn actually does something.


Implementation
    public function get warnEnabled():Boolean
warnTargetproperty 
public var warnTarget:ILogTarget

The logger for warn level, if not added (== null) warn is not enabled.

Constructor Detail
Logger()Constructor
public function Logger(name:String, person:String = null)

Creates a new Logger Proxy.

Parameters
name:String — Name of the logger
 
person:String (default = null)
Method Detail
debug()method
public function debug(message:*, parameters:Array = null):void

Logs a message for debug purposes.

Debug messages should be messages that are additional output used to ease the debugging of an application.

A message can contain place holders that are filled with the additional parameters. The ILogTarget implementation may treat the options as they want.

Example for a message with parameters:

           logger.debug("A: {0} is B: {1}", "Hello", "World");
           // A: Hello is B: World
         

Parameters

message:* — Message that should be logged.
 
parameters:Array (default = null) — List of parameters.

error()method 
public function error(message:*, parameters:Array = null):void

Logs a message to notify about an error that was dodged by the application.

The Error level is designated to be used in case an error occurred and the error could be dodged. It should contain hints about why that error occurs and if there is a common case where this error occurs.

A message can contain place holders that are filled with the additional parameters. The ILogTarget implementation may treat the options as they want.

Example for a message with parameters:

           logger.error("A: {0} is B: {1}", "Hello", "World");
           // A: Hello is B: World
         

Parameters

message:* — Message that should be logged.
 
parameters:Array (default = null) — List of parameters.

fatal()method 
public function fatal(message:*, parameters:Array = null):void

Logs a message to notify about an error that broke the application and couldn't be fixed automatically.

The Fatal level is designated to be used in case an error occurred that couldn't be stopped. A fatal error usually results in a inconsistent or inperceivable application state.

A message can contain place holders that are filled with the additional parameters. The ILogTarget implementation may treat the options as they want.

Example for a message with parameters:

           logger.fatal("A: {0} is B: {1}", "Hello", "World");
           // A: Hello is B: World
         

Parameters

message:* — Message that should be logged.
 
parameters:Array (default = null) — List of parameters.

info()method 
public function info(message:*, parameters:Array = null):void

Logs a message for notification purposes.

Notification messages should be messages that highlight interesting informations about what happens in the the application.

A message can contain place holders that are filled with the additional parameters. The ILogTarget implementation may treat the options as they want.

Example for a message with parameters:

           logger.info("A: {0} is B: {1}", "Hello", "World");
           // A: Hello is B: World
         

Parameters

message:* — Message that should be logged.
 
parameters:Array (default = null) — List of parameters.

toString()method 
public function toString():String

String representation of the Logger.

Returns
String
warn()method 
public function warn(message:*, parameters:Array = null):void

Logs a message for warning about a undesirable application state.

Warnings are designated to be used in case code got executed that is not desirable for performance, memory or clarity reasons but didn't result in any error.

A message can contain place holders that are filled with the additional parameters. The ILogTarget implementation may treat the options as they want.

Example for a message with parameters:

           logger.warn("A: {0} is B: {1}", "Hello", "World");
           // A: Hello is B: World
         

Parameters

message:* — Message that should be logged.
 
parameters:Array (default = null) — List of parameters.