OverviewSingleDeprecated

jsx3.util

class Logger.MemoryHandler

Object
->jsx3.lang.Object
  ->jsx3.util.Logger.Handler
    ->jsx3.util.Logger.MemoryHandler

class Logger.MemoryHandler
extends jsx3.util.Logger.Handler
A simple Handler class that stores a rotating cache of log records in memory.

May be configured with the bufferSize property (default 100).

Constructor Summary
void
init(strName : ?)
Instance initializer.
Method Summary
void
Clears the contents of the buffer.
int
Returns the size of the buffer.
Array<jsx3.util.Logger.Record>
getRecords(intCount : int)
Returns the contents of the record buffer.
void
Stores the log record in memory.
void
setBufferSize(intBufferSize : int)
Sets the size of the buffer.
Methods Inherited From jsx3.util.Logger.Handler
getLevel, getName, isLoggable, setLevel
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf, toString
Constructor Detail

init

void init(strName : ?)
Instance initializer.

Parameters:

strName
Method Detail

clearBuffer

void clearBuffer()
Clears the contents of the buffer.

getBufferSize

int getBufferSize()
Returns the size of the buffer. This handler will store at most this many log records before discarding old ones.

Returns:

 

getRecords

Array<jsx3.util.Logger.Record> getRecords(intCount : int)
Returns the contents of the record buffer.

Parameters:

intCountthe number of records to return, the most recently added records will be returned. Pass null to get all records.

Returns:

 

handle

void handle(objRecord : jsx3.util.Logger.Record)
Stores the log record in memory. Removes the oldest record if the buffer is full.

Parameters:

objRecord

Overrides:

handle in jsx3.util.Logger.Handler

setBufferSize

void setBufferSize(intBufferSize : int)
Sets the size of the buffer. If this operation decreases the size of the buffer, log records may be discarded.

Parameters:

intBufferSize