Packageorg.as3commons.logging.api
Interfacepublic interface ILogger
Implementors Logger

A ILogger defines the public access for any kind of logging request.

ILogger offers the common methods to log your traces like debug, info, warning, error, fatal. Each of these methods gets treated separately by the logging framework.

Performance Note: If you have a log statement that does intense processing or intense stringification it will be executed no matter if a log target is actually in place.

       // This will call the complexStringifcation no matter if it will do actually
       // something.
       logger.info( complexStringification() );
       
       if( logger.infoEnabled ) {
          // will just call the stringification in case the info is enabled
          logger.info( complexStringification() );
       }
     

See also

LoggerFactory
org.as3commons.logging.api.getLogger()
org.as3commons.logging.api.getNamedLogger()


Public Properties
 PropertyDefined By
  debugEnabled : Boolean
[read-only] true if debug actually does something.
ILogger
  errorEnabled : Boolean
[read-only] true if error actually does something.
ILogger
  fatalEnabled : Boolean
[read-only] true if fatal works.
ILogger
  infoEnabled : Boolean
[read-only] true if info actually does something.
ILogger
  name : String
[read-only] Getter for the name this instance.
ILogger
  person : String
[read-only] Returns the person that this logger created.
ILogger
  shortName : String
[read-only] Returns the short form of the name.
ILogger
  warnEnabled : Boolean
[read-only] true if warn actually does something.
ILogger
Public Methods
 MethodDefined By
  
debug(message:*, parameters:Array = null):void
Logs a message for debug purposes.
ILogger
  
error(message:*, parameters:Array = null):void
Logs a message to notify about an error that was dodged by the application.
ILogger
  
fatal(message:*, parameters:Array = null):void
Logs a message to notify about an error that broke the application and couldn't be fixed automatically.
ILogger
  
info(message:*, parameters:Array = null):void
Logs a message for notification purposes.
ILogger
  
warn(message:*, parameters:Array = null):void
Logs a message for warning about a undesirable application state.
ILogger
Property Detail
debugEnabledproperty
debugEnabled:Boolean  [read-only]

true if debug actually does something.


Implementation
    public function get debugEnabled():Boolean

See also

errorEnabledproperty 
errorEnabled:Boolean  [read-only]

true if error actually does something.


Implementation
    public function get errorEnabled():Boolean

See also

fatalEnabledproperty 
fatalEnabled:Boolean  [read-only]

true if fatal works.


Implementation
    public function get fatalEnabled():Boolean

See also

infoEnabledproperty 
infoEnabled:Boolean  [read-only]

true if info actually does something.


Implementation
    public function get infoEnabled():Boolean

See also

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

See also


Example
If the name is com.some.MyClass then the short name is MyClass.
warnEnabledproperty 
warnEnabled:Boolean  [read-only]

true if warn actually does something.


Implementation
    public function get warnEnabled():Boolean

See also

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.

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.