public class EventLog extends Object
This is not the main "logcat" debugging log (Log
)!
These diagnostic events are for system integrators, not application authors.
Events use integer tag codes corresponding to /system/etc/event-log-tags. They carry a payload of one or more int, long, or String values. The event-log-tags file defines the payload contents for each type code.
Modifier and Type | Class and Description |
---|---|
static class |
EventLog.Event
A previously logged event read from the logs.
|
Constructor and Description |
---|
EventLog() |
Modifier and Type | Method and Description |
---|---|
static int |
getTagCode(String name)
Get the event type tag code associated with an event name.
|
static String |
getTagName(int tag)
Get the name associated with an event type tag code.
|
static void |
readEvents(int[] tags,
Collection<EventLog.Event> output)
Read events from the log, filtered by type.
|
static int |
writeEvent(int tag,
float value)
Record an event log message.
|
static int |
writeEvent(int tag,
int value)
Record an event log message.
|
static int |
writeEvent(int tag,
long value)
Record an event log message.
|
static int |
writeEvent(int tag,
Object... list)
Record an event log message.
|
static int |
writeEvent(int tag,
String str)
Record an event log message.
|
public static int writeEvent(int tag, int value)
tag
- The event type tag codevalue
- A value to logpublic static int writeEvent(int tag, long value)
tag
- The event type tag codevalue
- A value to logpublic static int writeEvent(int tag, float value)
tag
- The event type tag codevalue
- A value to logpublic static int writeEvent(int tag, String str)
tag
- The event type tag codestr
- A value to logpublic static int writeEvent(int tag, Object... list)
tag
- The event type tag codelist
- A list of values to logpublic static void readEvents(int[] tags, Collection<EventLog.Event> output) throws IOException
tags
- to search foroutput
- container to add events intoIOException
- if something goes wrong reading eventspublic static String getTagName(int tag)
tag
- code to look uppublic static int getTagCode(String name)
name
- of event to look up