LuminicBox.Log

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 LuminicBox.Log.*;
var log = new Logger();
log.addPublisher( new TracePublisher() );
// ...
log.debug("debug message");
log.info("info message");
// ...
var xml = new XML("<note><to>John</to><from>Dana</from><heading>Reminder</heading><body>Don´t forget the milk</body></note>");
log.debug(xml);

Constructor Summary

Logger(logId:String)

Method Summary

setLevel(level:Level)
addPublisher(publisher:IPublisher)
removePublisher(publisher:IPublisher)
getPublishers()
log(argument)
debug(argument)
info(argument)
warn(argument)
error(argument)
fatal(argument)

Constructor Details

Logger

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 Details

setLevel

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.

addPublisher

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.

removePublisher

removePublisher(publisher:IPublisher):Void

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

getPublishers

getPublishers():Array

Return the publishers collection.

log

log(argument):Void

Logs an object or message with the LOG level.

Parameters
argument - The message or object to inspect.

debug

debug(argument):Void

Logs an object or message with the DEBUG level.

Parameters
argument - The message or object to inspect.

info

info(argument):Void

Logs an object or message with the INFO level.

Parameters
argument - The message or object to inspect.

warn

warn(argument):Void

Logs an object or message with the WARN level.

Parameters
argument - The message or object to inspect.

error

error(argument):Void

Logs an object or message with the ERROR level.

Parameters
argument - The message or object to inspect.

fatal

fatal(argument):Void

Logs an object or message with the FATAL level.

Parameters
argument - The message or object to inspect.