-
public interface LogcatThe interface to work with logcat.
-
-
Method Summary
Modifier and Type Method Description abstract UnitdisableChatty()NOT WORKING ON ANDROID 8+The problem: Android OS has a special introduced mechanism to filter and collapse of some bunches of logs produced by applications. abstract UnitsetBufferSize(LogcatBufferSize size)Set new logcat buffer size abstract UnitsetDefaultBufferSize()Set default logcat buffer size abstract Unitclear(Logcat.Buffer buffer)Clear (flush) the selected buffers and exit. abstract List<String>readLogcatRows(String excludePattern, Boolean excludePatternIsIgnoreCase, String includePattern, Boolean includePatternIsIgnoreCase, Logcat.Buffer buffer, Integer rowLimit)Get logcat dump as list of strings abstract BooleanreadLogcatRows(String excludePattern, Boolean excludePatternIsIgnoreCase, String includePattern, Boolean includePatternIsIgnoreCase, Logcat.Buffer buffer, Integer rowLimit, Function1<String, Boolean> readingBlock)Get logcat dump and analyze each row. -
-
Method Detail
-
disableChatty
abstract Unit disableChatty()
NOT WORKING ON ANDROID 8+
The problem: Android OS has a special introduced mechanism to filter and collapse of some bunches of logs produced by applications. The name of the such mechanism is Chatty. Chatty turns on when an application writes a lot of logs. The goal of Logcat interface is to analyze all logs. But Chatty prevents achievement of the mentioned goal. That's why, there is this method to disable Chatty. Please, call the method in "before" section of a test.
-
setBufferSize
abstract Unit setBufferSize(LogcatBufferSize size)
Set new logcat buffer size
- Parameters:
size- a LogcatBufferSize value
-
setDefaultBufferSize
abstract Unit setDefaultBufferSize()
Set default logcat buffer size
-
clear
abstract Unit clear(Logcat.Buffer buffer)
Clear (flush) the selected buffers and exit. The default buffer set is main, system and crash.
- Parameters:
buffer- one of available logcat buffers
-
readLogcatRows
abstract List<String> readLogcatRows(String excludePattern, Boolean excludePatternIsIgnoreCase, String includePattern, Boolean includePatternIsIgnoreCase, Logcat.Buffer buffer, Integer rowLimit)
Get logcat dump as list of strings
- Parameters:
excludePattern- logcat will EXCLUDE rows that match the patternexcludePatternIsIgnoreCase- boolean is exclude pattern must ignore string caseincludePattern- logcat will contains ONLY rows that match the patternincludePatternIsIgnoreCase- boolean is include pattern must ignore string casebuffer- one of available logcat buffersrowLimit- limiter of logcat output, starts FROM BEGINNING of logcat dump WITH EXTRA ROW of buffer beginning, if null return all rows
-
readLogcatRows
abstract Boolean readLogcatRows(String excludePattern, Boolean excludePatternIsIgnoreCase, String includePattern, Boolean includePatternIsIgnoreCase, Logcat.Buffer buffer, Integer rowLimit, Function1<String, Boolean> readingBlock)
Get logcat dump and analyze each row. Logcat reading stops if analyzerBlock returns false on some row
- Parameters:
excludePattern- logcat will EXCLUDE rows that match the patternexcludePatternIsIgnoreCase- boolean is exclude pattern must ignore string caseincludePattern- logcat will contains ONLY rows that match the patternincludePatternIsIgnoreCase- boolean is include pattern must ignore string casebuffer- one of available logcat buffersrowLimit- limiter of logcat output, starts FROM BEGINNING of logcat dump WITH EXTRA ROW of buffer beginning, if null return all rowsreadingBlock- lambda with String input and Boolean output.
-
-
-
-