Build 1.0_r1(from source)

android.util
Class EventLog

java.lang.Object
  extended by android.util.EventLog

public class EventLog
extends Object

Dynamically defined (in terms of event types), space efficient (i.e. "tight") event logging to help instrument code for large scale stability and performance monitoring. Note that this class contains all static methods. This is done for efficiency reasons. Events for the event log are self-describing binary data structures. They start with a 20 byte header (generated automatically) which contains all of the following in order:

The above is followed by a payload, comprised of the following: Note that all output is done in the endian-ness of the device (as determined by ByteOrder.nativeOrder()).


Nested Class Summary
static class EventLog.Event
          A previously logged event read from the logs.
static class EventLog.List
          An immutable tuple used to log a heterogeneous set of loggable items.
 
Field Summary
static byte INT
           
static byte LIST
           
static byte LONG
           
static byte STRING
           
 
Constructor Summary
EventLog()
           
 
Method Summary
static void readEvents(int[] tags, Collection<EventLog.Event> output)
          Read events from the log, filtered by type.
static int writeEvent(int tag, EventLog.List list)
          Send an event log message.
static int writeEvent(int tag, int value)
          Send an event log message.
static int writeEvent(int tag, long value)
          Send an event log message.
static int writeEvent(int tag, Object... list)
          Send an event log message.
static int writeEvent(int tag, String str)
          Send an event log message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INT

public static final byte INT
See Also:
Constant Field Values

LONG

public static final byte LONG
See Also:
Constant Field Values

STRING

public static final byte STRING
See Also:
Constant Field Values

LIST

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

EventLog

public EventLog()
Method Detail

writeEvent

public static int writeEvent(int tag,
                             int value)
Send an event log message.

Parameters:
tag - An event identifer
value - A value to log
Returns:
The number of bytes written

writeEvent

public static int writeEvent(int tag,
                             long value)
Send an event log message.

Parameters:
tag - An event identifer
value - A value to log
Returns:
The number of bytes written

writeEvent

public static int writeEvent(int tag,
                             String str)
Send an event log message.

Parameters:
tag - An event identifer
str - A value to log
Returns:
The number of bytes written

writeEvent

public static int writeEvent(int tag,
                             EventLog.List list)
Send an event log message.

Parameters:
tag - An event identifer
list - A EventLog.List to log
Returns:
The number of bytes written

writeEvent

public static int writeEvent(int tag,
                             Object... list)
Send an event log message.

Parameters:
tag - An event identifer
list - A list of values to log
Returns:
The number of bytes written

readEvents

public static void readEvents(int[] tags,
                              Collection<EventLog.Event> output)
                       throws IOException
Read events from the log, filtered by type.

Parameters:
tags - to search for
output - container to add events into
Throws:
IOException - if something goes wrong reading events

Build 1.0_r1(from source)

Please submit a feedback, bug or feature