|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.system.EventLogger
Logs events into the persistent store.
Events are persistent across reset. The device maintains an event queue; when the log gets too full, new events push old ones out of the front of the queue.
To use the event logger, you should invoke one of the
register methods with your applications GUID to register
your application to log events. The GUID can be created in the IDE by
right-clicking a String, and selecting "Convert String to Long". You can then use the various
logEvent methods to log events in the system's event log.
To be written into the log, each posted event must either have an event
level equal to or lower then the current cut off point or be logged with the
ALWAYS_LOG event level.
The default cut off point is WARNING. That is, by default, only
events logged with
WARNING,
ERROR,
SEVERE_ERROR, or
ALWAYS_LOG are actually written in the log.
| Field Summary | ||
static int |
ALWAYS_LOG
Always log event, regardless of severity. |
|
static int |
DEBUG_INFO
Debug information level event. |
|
static int |
ERROR
Error level event. |
|
static int |
INFORMATION
Information level event. |
|
static int |
SEVERE_ERROR
Severe level event. |
|
static long |
SYSTEM_LOG_GUID
System event log GUID. |
|
static int |
VIEWER_EXCEPTION
Exception event viewer. |
|
static int |
VIEWER_NUMBER
Number event viewer. |
|
static int |
VIEWER_STRING
String event viewer. |
|
static int |
WARNING
Warning level event. |
|
| Method Summary | ||
static void |
clearLog()
Clears the EventLog of all events. |
|
static int |
getInt(byte[] data)
Transmogrify a byte array into an integer. |
|
static int |
getMinimumLevel()
Retrieves the current minimum logging level. |
|
static String |
getRegisteredAppName(long forGUID)
Retrieves name of application given GUID. |
|
static int |
getRegisteredViewerType(long forGUID)
Retrieves the viewer type registered for an application given GUID. |
|
static boolean |
logEvent(long guid,
byte[] data)
Logs an ALWAYS_LOG level event for an application.
|
|
static boolean |
logEvent(long guid,
byte[] data,
int level)
Logs an event for an application. |
|
static boolean |
logEvent(long guid,
int value)
Logs an ALWAYS_LOG level numeric event for an application.
|
|
static boolean |
logEvent(long guid,
int value,
int level)
Logs a numeric event for an application. |
|
static boolean |
register(long guid,
String name)
Registers the calling application's name and guid. |
|
static boolean |
register(long guid,
String name,
int viewerType)
Registers the calling application's name and guid, with a particular viewer type. |
|
static void |
setMinimumLevel(int level)
Sets the new minimum level for logging. |
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final long SYSTEM_LOG_GUID
Used for text messages.
| Method Detail |
public static final boolean register(long guid,
String name,
int viewerType)
You must invoke this method before the logger can log events with the given GUID.
guid - GUID of the registering application.name - Name of the registering application.viewerType - Type of viewer to be used when displaying the event
(one of VIEWER_NUMBER,
VIEWER_STRING,
VIEWER_EXCEPTION).viewer - Application specific event viewer for this application (if
any).
public static final boolean register(long guid,
String name)
You must invoke this method before the logger can log events with the
given GUID. This method uses the default VIEWER_NUMBER type for
displaying events.
guid - GUID of the registering application.name - Name of the registering application.public static final int getRegisteredViewerType(long forGUID)
forGUID - GUID of registered application.VIEWER_NUMBER, VIEWER_STRING, VIEWER_EXCEPTION.public static final String getRegisteredAppName(long forGUID)
forGUID - GUID of the registered application.
public static final boolean logEvent(long guid,
byte[] data,
int level)
The invoker must provide an already-registered GUID (with one of the
register methods).
guid - GUID of the application logging the event.data - Data to log.level - Level for this event.
public static final boolean logEvent(long guid,
byte[] data)
ALWAYS_LOG level event for an application.
The invoker must provide an already-registered GUID (with one of the
register methods).
guid - GUID of the application logging the event.data - Data to log.
public static final boolean logEvent(long guid,
int value,
int level)
The event in this case is always some integer value.
The invoker must provide an already-registered GUID (with one of the
register methods).
guid - GUID of the application logging the event.value - Numeric value of the event.level - Level for this event.
public static final boolean logEvent(long guid,
int value)
ALWAYS_LOG level numeric event for an application.
The event in this case is always some integer value.
The invoker must provide an already-registered GUID (with one of the
register methods).
guid - GUID of the application logging the event.value - Numeric value of the event.public static final int getMinimumLevel()
public static final void setMinimumLevel(int level)
level - New minimum logging level.public static int getInt(byte[] data)
data - Byte array to transmogrify.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.