EventLog
open class EventLog
kotlin.Any | |
↳ | android.util.EventLog |
Access to the system diagnostic event record. System diagnostic events are used to record certain system-level events (such as garbage collection, activity manager state, system watchdogs, and other low level activity), which may be automatically collected and analyzed during system development.
This is not the main "logcat" debugging log (android.util.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.
Summary
Nested classes | |
---|---|
A previously logged event read from the logs. |
Public methods | |
---|---|
open static Int |
getTagCode(name: String!) Get the event type tag code associated with an event name. |
open static String! |
getTagName(tag: Int) Get the name associated with an event type tag code. |
open static Unit |
readEvents(tags: IntArray!, output: MutableCollection<EventLog.Event!>!) Read events from the log, filtered by type. |
open static Int |
writeEvent(tag: Int, value: Int) Record an event log message. |
open static Int |
writeEvent(tag: Int, value: Long) Record an event log message. |
open static Int |
writeEvent(tag: Int, value: Float) Record an event log message. |
open static Int |
writeEvent(tag: Int, str: String!) Record an event log message. |
open static Int |
writeEvent(tag: Int, vararg list: Any!) Record an event log message. |
Public methods
getTagCode
open static fun getTagCode(name: String!): Int
Get the event type tag code associated with an event name.
Parameters | |
---|---|
name |
String!: of event to look up |
Return | |
---|---|
Int |
the tag code, or -1 if no tag has that name |
getTagName
open static fun getTagName(tag: Int): String!
Get the name associated with an event type tag code.
Parameters | |
---|---|
tag |
Int: code to look up |
Return | |
---|---|
String! |
the name of the tag, or null if no tag has that number |
readEvents
open static fun readEvents(
tags: IntArray!,
output: MutableCollection<EventLog.Event!>!
): Unit
Read events from the log, filtered by type.
Parameters | |
---|---|
tags |
IntArray!: to search for |
output |
MutableCollection<EventLog.Event!>!: container to add events into |
Exceptions | |
---|---|
java.io.IOException |
if something goes wrong reading events |
writeEvent
open static fun writeEvent(
tag: Int,
value: Int
): Int
Record an event log message.
Parameters | |
---|---|
tag |
Int: The event type tag code |
value |
Int: A value to log |
Return | |
---|---|
Int |
The number of bytes written |
writeEvent
open static fun writeEvent(
tag: Int,
value: Long
): Int
Record an event log message.
Parameters | |
---|---|
tag |
Int: The event type tag code |
value |
Long: A value to log |
Return | |
---|---|
Int |
The number of bytes written |
writeEvent
open static fun writeEvent(
tag: Int,
value: Float
): Int
Record an event log message.
Parameters | |
---|---|
tag |
Int: The event type tag code |
value |
Float: A value to log |
Return | |
---|---|
Int |
The number of bytes written |
writeEvent
open static fun writeEvent(
tag: Int,
str: String!
): Int
Record an event log message.
Parameters | |
---|---|
tag |
Int: The event type tag code |
str |
String!: A value to log |
Return | |
---|---|
Int |
The number of bytes written |
writeEvent
open static fun writeEvent(
tag: Int,
vararg list: Any!
): Int
Record an event log message.
Parameters | |
---|---|
tag |
Int: The event type tag code |
list |
Any!: A list of values to log |
Return | |
---|---|
Int |
The number of bytes written |