class LogListener
extends java.lang.Object
services.| Modifier and Type | Field and Description |
|---|---|
private android.content.Context |
context |
private int |
pollFrequencyMs
Frequency to check for new log messages (ms).
|
private java.util.List<LoggingService> |
services |
protected boolean |
stop
Set to
true to stop monitoring logcat output |
protected Utils |
utils |
private boolean |
wifiOnly |
| Constructor and Description |
|---|
LogListener(android.content.Context context,
java.util.List<LoggingService> services,
boolean wifiOnly) |
| Modifier and Type | Method and Description |
|---|---|
(package private) java.util.List<java.lang.String> |
getNewLogs()
Return output from `logcat -d` (print and exit) command, then clear logcat using `logcat -c`
|
(package private) boolean |
isRunning()
Used to check if this class is already running.
|
protected void |
processLogEntries(java.util.List<java.lang.String> logs)
Pass all error entries to all enabled services.
|
protected void |
processNewLogs()
Get & process new logcat messages
|
(package private) java.lang.Process |
runLogcatCommand(java.lang.String commandLineArgs)
Execute system
logcat command, return the Process object. |
void |
start()
Start monitoring logcat output
|
protected void |
startMonitoringLogcat()
In a new thread, continuously check new log messages and process any new errors log messages.
|
(package private) void |
stop()
Set flat to stop monitoring logcat.
|
private android.content.Context context
protected Utils utils
private java.util.List<LoggingService> services
private boolean wifiOnly
protected boolean stop
true to stop monitoring logcat outputprivate int pollFrequencyMs
LogListener(android.content.Context context,
java.util.List<LoggingService> services,
boolean wifiOnly)
public void start()
protected void startMonitoringLogcat()
protected void processNewLogs()
java.util.List<java.lang.String> getNewLogs()
java.lang.Process runLogcatCommand(java.lang.String commandLineArgs)
throws java.io.IOException
logcat command, return the Process object.commandLineArgs - Argument to pass to logcatjava.io.IOException - If there was an IO problem reading from logcat.protected void processLogEntries(java.util.List<java.lang.String> logs)
logs - Logs to process (check if they are errors, and send them to each enabled service).void stop()
boolean isRunning()