Skip to content

Commit f99533c

Browse files
fix: Update the definition of 'logcatFilterSpecs' option (#2258)
1 parent a13724b commit f99533c

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/main/java/io/appium/java_client/android/options/adb/SupportsLogcatFilterSpecsOption.java

+14-10
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,36 @@
2020
import io.appium.java_client.remote.options.CanSetCapability;
2121
import org.openqa.selenium.Capabilities;
2222

23+
import java.util.List;
2324
import java.util.Optional;
2425

2526
public interface SupportsLogcatFilterSpecsOption<T extends BaseOptions<T>> extends
2627
Capabilities, CanSetCapability<T> {
2728
String LOGCAT_FILTER_SPECS_OPTION = "logcatFilterSpecs";
2829

2930
/**
30-
* Series of tag[:priority] where tag is a log component tag (or * for all)
31-
* and priority is: V Verbose, D Debug, I Info, W Warn, E Error, F Fatal,
32-
* S Silent (supress all output). '' means ':d' and tag by itself means tag:v.
33-
* If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.
34-
* If no filterspec is found, filter defaults to '*:I'.
31+
* Allows to customize logcat output filtering.
3532
*
36-
* @param format The filter specifier.
33+
* @param format The filter specifier. Consists from series of `tag[:priority]` items,
34+
* where `tag` is a log component tag (or `*` to match any value)
35+
* and `priority`: V (Verbose), D (Debug), I (Info), W (Warn), E (Error), F (Fatal),
36+
* S (Silent - supresses all output). `tag` without `priority` defaults to `tag:v`.
37+
* If not specified, filterspec is set from ANDROID_LOG_TAGS environment variable.
38+
* If no filterspec is found, filter defaults to `*:I`, which means
39+
* to only show log lines with any tag and the log level INFO or higher.
3740
* @return self instance for chaining.
3841
*/
39-
default T setLogcatFilterSpecs(String format) {
42+
default T setLogcatFilterSpecs(List<String> format) {
4043
return amend(LOGCAT_FILTER_SPECS_OPTION, format);
4144
}
4245

4346
/**
4447
* Get the logcat filter format.
4548
*
46-
* @return Format specifier.
49+
* @return Format specifier. See the documentation on {@link #setLogcatFilterSpecs(List)} for more details.
4750
*/
48-
default Optional<String> getLogcatFilterSpecs() {
49-
return Optional.ofNullable((String) getCapability(LOGCAT_FILTER_SPECS_OPTION));
51+
default Optional<List<String>> getLogcatFilterSpecs() {
52+
//noinspection unchecked
53+
return Optional.ofNullable((List<String>) getCapability(LOGCAT_FILTER_SPECS_OPTION));
5054
}
5155
}

0 commit comments

Comments
 (0)