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.
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);
Logger(logId:String) |
setLevel(level:Level) | |||
addPublisher(publisher:IPublisher) | |||
removePublisher(publisher:IPublisher) | |||
getPublishers() | |||
log(argument) | |||
debug(argument) | |||
info(argument) | |||
warn(argument) | |||
error(argument) | |||
fatal(argument) |
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)
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(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(publisher:IPublisher):Void
Removes a Publisher from the publishers collection. A new instance of that kind of publisher can be supplied.
getPublishers():Array
Return the publishers collection.
log(argument):Void
Logs an object or message with the LOG level.
- Parameters
argument - The message or object to inspect.
debug(argument):Void
Logs an object or message with the DEBUG level.
- Parameters
argument - The message or object to inspect.
info(argument):Void
Logs an object or message with the INFO level.
- Parameters
argument - The message or object to inspect.
warn(argument):Void
Logs an object or message with the WARN level.
- Parameters
argument - The message or object to inspect.
error(argument):Void
Logs an object or message with the ERROR level.
- Parameters
argument - The message or object to inspect.
fatal(argument):Void
Logs an object or message with the FATAL level.
- Parameters
argument - The message or object to inspect.