Packagecom.luminicbox.log
Classpublic class Logger

Main Class.
This class contains methods for logging messages at differente levels.
These messages can me basic types (strings, numbers, dates) or complex objects and MovieClips.
There are also configuration methods.

Example:

  import com.luminicbox.log.
var log:Logger = new Logger( "myLogger" );
log.addPublisher( new TracePublisher() );
// ...
log.debug( "debug message" );
log.info( "info message" );
// ...
var xml:XML = new XML( <note><to>John</to><from>Dana</from><heading>Reminder</heading><body>Don´t forget the milk</body></note> );
log.debug( xml );



Public Methods
 MethodDefined by
  
Logger(logId:String)
Creates a new Logger instance.
The logId parameter is optional.
Logger
  
addPublisher(publisher:IPublisher):void
Adds a Publisher to the publishers collection.
Logger
  
debug(argument:Object):void
Logs an object or message with the DEBUG level.
Logger
  
error(argument:Object):void
Logs an object or message with the ERROR level.
Logger
  
fatal(argument:Object):void
Logs an object or message with the FATAL level.
Logger
  
getPublishers():Array
Return the publishers collection.
Logger
  
info(argument:Object):void
Logs an object or message with the INFO level.
Logger
  
log(argument:Object):void
Logs an object or message with the LOG level.
Logger
  
removePublisher(publisher:IPublisher):void
Removes a Publisher from the publishers collection.
Logger
  
setLevel(level:Level):void
Sets the lowest required level for any message.
Any message that have a level that is lower than the supplied value will be ignored.
This is the most basic form of filter.
Logger
  
warn(argument:Object):void
Logs an object or message with the WARN level.
Logger
Constructor detail
Logger()constructor
public function Logger(logId:String)

Creates a new Logger instance.
The logId parameter is optional. It identifies the logger and all messages to the publisher will be sent with this ID.

Parameters
logId:String — String (optional)
Method detail
addPublisher()method
public function addPublisher(publisher:IPublisher):void

Adds a Publisher to the publishers collection. The supplied publisher must implement the IPublisher interface
There can only be one instance of each Publisher.

Parameters
publisher:IPublisher
debug()method 
public function debug(argument:Object):void

Logs an object or message with the DEBUG level.

Parameters
argument:Object — The message or object to inspect.
error()method 
public function error(argument:Object):void

Logs an object or message with the ERROR level.

Parameters
argument:Object — The message or object to inspect.
fatal()method 
public function fatal(argument:Object):void

Logs an object or message with the FATAL level.

Parameters
argument:Object — The message or object to inspect.
getPublishers()method 
public function getPublishers():Array

Return the publishers collection.

Returns
Array
info()method 
public function info(argument:Object):void

Logs an object or message with the INFO level.

Parameters
argument:Object — The message or object to inspect.
log()method 
public function log(argument:Object):void

Logs an object or message with the LOG level.

Parameters
argument:Object — The message or object to inspect.
removePublisher()method 
public function removePublisher(publisher:IPublisher):void

Removes a Publisher from the publishers collection. A new instance of that kind of publisher can be supplied.

Parameters
publisher:IPublisher
setLevel()method 
public function setLevel(level:Level):void

Sets the lowest required level for any message.
Any message that have a level that is lower than the supplied value will be ignored.
This is the most basic form of filter.

Parameters
level:Level
warn()method 
public function warn(argument:Object):void

Logs an object or message with the WARN level.

Parameters
argument:Object — The message or object to inspect.