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

Constants

String LOGCAT_CMD

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 methods

void clear()
InputStreamSource getLogcatData(int maxBytes)
InputStreamSource getLogcatData()
void start()
void stop()

Constants

LOGCAT_CMD

String LOGCAT_CMD

Constant Value: "logcat -v threadtime"

Public constructors

LogcatReceiver

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

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

void clear ()

getLogcatData

InputStreamSource getLogcatData (int maxBytes)

Parameters
maxBytes int
Returns
InputStreamSource

getLogcatData

InputStreamSource getLogcatData ()

Returns
InputStreamSource

start

void start ()

stop

void stop ()