com. kelvinluck. util. LogWrapper

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!

Version

0.1.0

See Also

SOSLogPublisher

LuminicBox.Log.ConsolePublisher

LuminicBox.Log.TracePublisher

http://kelvinluck.com/article/logging-from-fame

Author

Kelvin Luck kel.nosp@m.vin@kelvinl.nosp@m.uck.com (but it just wraps the LuminicBox code which I didn’t write)

Summary
Class to wrap the LuminicBox.Log logging system from http://www.luminicbox.com/blog/?page=post&id=2
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.
An integer representing a log level of DEBUG
An integer representing a log level of INFO
An integer representing a log level of WARN
An integer representing a log level of ERROR
An integer representing a log level of FATAL
Don’t call the constructor directly, instead use LogWrapper.getInstance
Function to be used in conjunction with the MTASC TRACE command.
Initalises the LogWrapper
Call this function if you want logged output to be displayed in the seperate “console” swf.
Call this function if you want logged output to be displayed in the trace window of the Flash IDE.
Returns a reference to the Single LogWrapper instance.
Returns a reference to the LuminicBox.Log.Logger instance that is being wrapped.

Variables

logCallingFile

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.

DEBUG

static public var DEBUG: Number

An integer representing a log level of DEBUG

INFO

static public var INFO: Number

An integer representing a log level of INFO

WARN

static public var WARN: Number

An integer representing a log level of WARN

ERROR

static public var ERROR: Number

An integer representing a log level of ERROR

FATAL

static public var FATAL: Number

An integer representing a log level of FATAL

_instance

static var _instance: LogWrapper

_log

private var _log: Logger

Functions

LogWrapper

private function LogWrapper()

Don’t call the constructor directly, instead use LogWrapper.getInstance

mtascTrace

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

To use add the following parameter to your mtasc commandline

-trace com.kelvinluck.util.LogWrapper.mtascTrace

init

public function init (logId: String):Void

Initalises the LogWrapper

addConsolePublisher

public function addConsolePublisher()

Call this function if you want logged output to be displayed in the seperate “console” swf.

See Also

LuminicBox.Log.ConsolePublisher

addTracePublisher

public function addTracePublisher()

Call this function if you want logged output to be displayed in the trace window of the Flash IDE.

See Also

LuminicBox.Log.TracePublisher

getInstance

public static function getInstance():LogWrapper

Returns a reference to the Single LogWrapper instance.

Returns

LogWrapperThe LogWrapper instance

getLog

public static function getLog():Logger

Returns a reference to the LuminicBox.Log.Logger instance that is being wrapped.

Returns

LoggerA reference to the LuminicBox.Log.Logger instance that is being wrapped

See Also

LuminicBox.Log.Logger

toString

public function toString():String
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.
static public var DEBUG: Number
An integer representing a log level of DEBUG
static public var INFO: Number
An integer representing a log level of INFO
static public var WARN: Number
An integer representing a log level of WARN
static public var ERROR: Number
An integer representing a log level of ERROR
static public var FATAL: Number
An integer representing a log level of FATAL
static var _instance: LogWrapper
private var _log: Logger
private function LogWrapper()
Don’t call the constructor directly, instead use LogWrapper.getInstance
public static function getInstance():LogWrapper
Returns a reference to the Single LogWrapper instance.
static function mtascTrace(message: Object,
level: Number,
className: String,
fileName: String,
lineNumber: Number)
Function to be used in conjunction with the MTASC TRACE command.
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.
public function addTracePublisher()
Call this function if you want logged output to be displayed in the trace window of the Flash IDE.
public static function getLog():Logger
Returns a reference to the LuminicBox.Log.Logger instance that is being wrapped.
public function toString():String
Class to add the ability to output logged data to the PowerFlasher Socket Output Server.