LogcatReceiver
public
class
LogcatReceiver
extends Object
implements
ILogcatReceiver
java.lang.Object
|
↳ |
com.android.tradefed.device.LogcatReceiver
|
Class that collects logcat in background. Continues to capture logcat even if device goes
offline then online.
Summary
Public constructors |
LogcatReceiver(ITestDevice device, String logcatCmd, long maxFileSize, int logStartDelay)
Creates an instance with any specified logcat command
|
LogcatReceiver(ITestDevice device, long maxFileSize, int logStartDelay)
Creates an instance with default logcat 'threadtime' format
|
Public constructors
LogcatReceiver
public LogcatReceiver (ITestDevice device,
String logcatCmd,
long maxFileSize,
int logStartDelay)
Creates an instance with any specified logcat command
Parameters |
device |
ITestDevice : the device to start logcat on |
logcatCmd |
String : the logcat command to run (including 'logcat' part), see details on
available options in logcat help message |
maxFileSize |
long : maximum file size, earlier lines will be discarded once size is reached |
logStartDelay |
int : the delay to wait after the device becomes online |
LogcatReceiver
public LogcatReceiver (ITestDevice device,
long maxFileSize,
int logStartDelay)
Creates an instance with default logcat 'threadtime' format
Parameters |
device |
ITestDevice : the device to start logcat on |
maxFileSize |
long : maximum file size, earlier lines will be discarded once size is reached |
logStartDelay |
int : the delay to wait after the device becomes online |
Public methods
clear
public void clear ()
getDefaultLogcatCmd
public static String getDefaultLogcatCmd (ITestDevice device)
Get the default logcat command, only append uid format if api level > 24.
Parameters |
device |
ITestDevice |
getLogcatData
public InputStreamSource getLogcatData (int maxBytes,
int offset)
Returns the current logcat buffer given an offset.
Parameters |
maxBytes |
int : The max size of the returned buffer |
offset |
int : The offset of the full buffer. |
start
public void start ()