com.virtualweaver.xotics.datamodel
Class XoLogMessageBuffer

java.lang.Object
  extended bycom.virtualweaver.xotics.datamodel.XoLogMessageBuffer

public final class XoLogMessageBuffer
extends java.lang.Object

Log Buffer queues various messages from Xotics classes and accessible for user level log messages.

Version:
4.1

Nested Class Summary
static class XoLogMessageBuffer.XoLogMessage
          Class representing a Xotics log message.
 
Field Summary
static byte ERROR
           
static byte INFO
           
static byte NONE
           
static byte WARNING
           
 
Constructor Summary
protected XoLogMessageBuffer()
          Constructor
 
Method Summary
 int getMaxSize()
          Returns the buffer size.
 void logError(java.lang.String msg)
          Sends an ERROR log message to the buffer.
 void logInfo(java.lang.String msg)
          Sends a INFO log message to the buffer.
 void logWarning(java.lang.String msg)
          Sends a WARNING log message to the buffer.
 XoLogMessageBuffer.XoLogMessage read()
          Returns and suppress the older log message from the buffer
 void setLogLevel(byte t)
          Sets the log level from which message are stored.
 void setMaxSize(int size)
          Sets the buffer size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO

public static final byte INFO
See Also:
Constant Field Values

WARNING

public static final byte WARNING
See Also:
Constant Field Values

ERROR

public static final byte ERROR
See Also:
Constant Field Values

NONE

public static final byte NONE
See Also:
Constant Field Values
Constructor Detail

XoLogMessageBuffer

protected XoLogMessageBuffer()
Constructor

Method Detail

setLogLevel

public void setLogLevel(byte t)
Sets the log level from which message are stored. Every message having a lower log level is discarded.

Parameters:
t - the log level to filter messages

setMaxSize

public void setMaxSize(int size)
Sets the buffer size. The last size number of messages are kept in buffer.

Parameters:
size - the last number of messages stored in buffer.

getMaxSize

public int getMaxSize()
Returns the buffer size.

Returns:
size of buffer

logInfo

public void logInfo(java.lang.String msg)
Sends a INFO log message to the buffer.

Parameters:
msg - the INFO message string

logWarning

public void logWarning(java.lang.String msg)
Sends a WARNING log message to the buffer.

Parameters:
msg - the WARNING message string

logError

public void logError(java.lang.String msg)
Sends an ERROR log message to the buffer.

Parameters:
msg - the ERROR message string

read

public XoLogMessageBuffer.XoLogMessage read()
Returns and suppress the older log message from the buffer

Returns:
the older message stored in the buffer