Home
log-ls provides a simple logging interface that makes it easy to record formatted log messages to one or more log printer:
package
{
import loom.Application;
import pixeldroid.util.Log;
import pixeldroid.util.LogLevel;
public class LogTest extends Application
{
private const _logName:String = getFullTypeName();
override public function run():void
{
Log.level = LogLevel.INFO;
Log.info(_logName, function():String { return _logName +' is running!'; });
}
}
}
Log messages are wrapped in a function closure to delay their execution until actually required.
Log.info('MyLogger', function():String { return 'message to log only if log level is INFO'; });
The default printer logs messages to the console.
A file printer is also provided.
The multi-printer can tee log messages to multiple targets.
Custom printers can be written against the Printer
api.