|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
org.openbandy.log.LogImpl
public class LogImpl
Implementation of the Log interface for use with CLDC and MIDP on mobile
devices. This class can write log message to a canvas (default), the devices
persistent RMS, or a file.
(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.
Field Summary | |
---|---|
LogConfiguration |
config
The configuration of the canvas as a screen |
static java.lang.String |
VALUE_DELIMITER
String value to delimit values |
static java.lang.String |
VARIABLE_DELIMITER
String value to delimit different variables |
Fields inherited from class javax.microedition.lcdui.Canvas |
---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
Constructor Summary | |
---|---|
LogImpl(LogConfiguration config)
Create a new LogImple instance and configure it accordingly |
Method Summary | |
---|---|
void |
clearCanvas()
Removes all log entries from canvas |
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
|
void |
debug(java.lang.Object origin,
java.lang.String message)
Logs a message with log level LEVEL_DEBUG |
void |
debug(java.lang.String originName,
java.lang.String message)
Logs a message with log level LEVEL_DEBUG |
void |
displayStoredLogMessages()
Print all persistently stored log messages to the canvas. |
void |
error(java.lang.Object origin,
java.lang.String message,
java.lang.Throwable exception)
Logs a message with log level LEVEL_ERROR |
void |
error(java.lang.String originName,
java.lang.String message,
java.lang.Throwable exception)
Logs a message with log level LEVEL_ERROR |
java.lang.String |
getPersistentLogAsString(javax.microedition.lcdui.Displayable currentDisplayable)
|
void |
info(java.lang.Object origin,
java.lang.String message)
Logs a message with log level LEVEL_INFO |
void |
info(java.lang.String originName,
java.lang.String message)
Logs a message with log level LEVEL_INFO |
void |
keyPressed(int key)
Called when a key is pressed, this method handles the scrolling |
void |
run()
|
void |
setLogLevel(int level)
Set the log level |
void |
setMIDlet(javax.microedition.midlet.MIDlet midlet)
|
void |
show(javax.microedition.lcdui.Display display,
javax.microedition.lcdui.Displayable previousDisplayable)
Tells the BandyDisplayable to set itself as the current screen. |
void |
warn(java.lang.Object origin,
java.lang.String message)
Logs a message with log level LEVEL_WARNING |
void |
warn(java.lang.String originName,
java.lang.String message)
Logs a message with log level LEVEL_WARNING |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, repaint, repaint, serviceRepaints, setCommandListener, setFullScreenMode |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VALUE_DELIMITER
public static final java.lang.String VARIABLE_DELIMITER
public LogConfiguration config
Constructor Detail |
---|
public LogImpl(LogConfiguration config)
config
- The (initial) log config that shall apply to this instanceMethod Detail |
---|
public void setMIDlet(javax.microedition.midlet.MIDlet midlet)
public void error(java.lang.Object origin, java.lang.String message, java.lang.Throwable exception)
error
in interface Log
origin
- The object reportingmessage
- The message to logexception
- The exception that was caused with this errorpublic void error(java.lang.String originName, java.lang.String message, java.lang.Throwable exception)
error
in interface Log
originName
- The class name of the object reportingmessage
- The message to logexception
- The exception that was caused with this errorpublic void warn(java.lang.Object origin, java.lang.String message)
warn
in interface Log
origin
- The object reportingmessage
- The message to logpublic void warn(java.lang.String originName, java.lang.String message)
warn
in interface Log
originName
- The class name of the object reportingmessage
- The message to logpublic void info(java.lang.Object origin, java.lang.String message)
info
in interface Log
origin
- The object reportingmessage
- The message to logpublic void info(java.lang.String originName, java.lang.String message)
info
in interface Log
originName
- The class name of the object reportingmessage
- The message to logpublic void debug(java.lang.Object origin, java.lang.String message)
debug
in interface Log
origin
- The object reportingmessage
- The message to logpublic void debug(java.lang.String originName, java.lang.String message)
debug
in interface Log
originName
- The class name of the object reportingmessage
- The message to logpublic void setLogLevel(int level)
Log
setLogLevel
in interface Log
level
- Log level according topublic void displayStoredLogMessages()
public void clearCanvas()
public void show(javax.microedition.lcdui.Display display, javax.microedition.lcdui.Displayable previousDisplayable)
BandyDisplayable
show
in interface BandyDisplayable
display
- The MIDlets displaypreviousDisplayable
- The displayable that is shown before this onepublic void keyPressed(int key)
keyPressed
in class javax.microedition.lcdui.Canvas
key
- number of the pressed keypublic void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
commandAction
in interface javax.microedition.lcdui.CommandListener
public void run()
run
in interface java.lang.Runnable
public java.lang.String getPersistentLogAsString(javax.microedition.lcdui.Displayable currentDisplayable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |