Class to wrap the LuminicBox.Log logging system from http://www.luminicbox.com- /blog- /?page=post- &id=2
I started out developing using Colin Moock’s org.moock.logger.Logger logging class then discovered this cooler one. I thought that rather than changing all my calls to the logger class I could just wrap the LumicBox class in this class of my own.
The class implements the Singleton pattern and provides access to the methods of LuminicBox.Log that I have needed...
Especially useful when used in conjection with a SOSLogPublisher and MTASC!
0.1.0
<LuminicBox.Log.ConsolePublisher>
<LuminicBox.Log.TracePublisher>
http://kelvinluck.com/article/logging-from-fame
Kelvin Luck kelvin@kelvinluck.com (but it just wraps the LuminicBox code which I didn’t write)
$Id: LogWrapper.as 37 2006-05-10 19:29:32Z kluck $
| com. kelvinluck. util. LogWrapper | Class to wrap the LuminicBox.Log logging system from http://www.luminicbox.com- /blog- /?page=post- &id=2 |
| logCallingFile | When used in conjunction with MTASC’s TRACE functionality this flags whether to output information about the file and class that the error was thrown at. |
| DEBUG | An integer representing a log level of DEBUG |
| INFO | An integer representing a log level of INFO |
| WARN | An integer representing a log level of WARN |
| ERROR | An integer representing a log level of ERROR |
| FATAL | An integer representing a log level of FATAL |
| LogWrapper | Don’t call the constructor directly, instead use LogWrapper.getInstance |
| mtascTrace | Function to be used in conjunction with the MTASC TRACE command. |
| init | Initalises the LogWrapper |
| addConsolePublisher | Call this function if you want logged output to be displayed in the seperate “console” swf. |
| addTracePublisher | Call this function if you want logged output to be displayed in the trace window of the Flash IDE. |
| getInstance | Returns a reference to the Single LogWrapper instance. |
| getLog | Returns a reference to the LuminicBox.Log.Logger instance that is being wrapped. |
static public var logCallingFile: Boolean
When used in conjunction with MTASC’s TRACE functionality this flags whether to output information about the file and class that the error was thrown at.
private function LogWrapper()
Don’t call the constructor directly, instead use LogWrapper.getInstance
static function mtascTrace( message: Object, level: Number, className: String, fileName: String, lineNumber: Number )
Function to be used in conjunction with the MTASC TRACE command. This has the advantage of adding className, fileName and lineNumber to your log if logCallingFile == true
-trace com.kelvinluck.util.LogWrapper.mtascTrace
public function init ( logId: String ):Void
Initalises the LogWrapper
public function addConsolePublisher()
Call this function if you want logged output to be displayed in the seperate “console” swf.
<LuminicBox.Log.ConsolePublisher>
public function addTracePublisher()
Call this function if you want logged output to be displayed in the trace window of the Flash IDE.
<LuminicBox.Log.TracePublisher>
When used in conjunction with MTASC’s TRACE functionality this flags whether to output information about the file and class that the error was thrown at.
static public var logCallingFile: Boolean
An integer representing a log level of DEBUG
static public var DEBUG: Number
An integer representing a log level of INFO
static public var INFO: Number
An integer representing a log level of WARN
static public var WARN: Number
An integer representing a log level of ERROR
static public var ERROR: Number
An integer representing a log level of FATAL
static public var FATAL: Number
Don’t call the constructor directly, instead use LogWrapper.getInstance
private function LogWrapper()
Returns a reference to the Single LogWrapper instance.
public static function getInstance():LogWrapper
Function to be used in conjunction with the MTASC TRACE command.
static function mtascTrace( message: Object, level: Number, className: String, fileName: String, lineNumber: Number )
Initalises the LogWrapper
public function init ( logId: String ):Void
Call this function if you want logged output to be displayed in the seperate “console” swf.
public function addConsolePublisher()
Call this function if you want logged output to be displayed in the trace window of the Flash IDE.
public function addTracePublisher()
Returns a reference to the LuminicBox.Log.Logger instance that is being wrapped.
public static function getLog():Logger