|
20 | 20 | import io.appium.java_client.remote.options.CanSetCapability;
|
21 | 21 | import org.openqa.selenium.Capabilities;
|
22 | 22 |
|
| 23 | +import java.util.List; |
23 | 24 | import java.util.Optional;
|
24 | 25 |
|
25 | 26 | public interface SupportsLogcatFilterSpecsOption<T extends BaseOptions<T>> extends
|
26 | 27 | Capabilities, CanSetCapability<T> {
|
27 | 28 | String LOGCAT_FILTER_SPECS_OPTION = "logcatFilterSpecs";
|
28 | 29 |
|
29 | 30 | /**
|
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. |
35 | 32 | *
|
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. |
37 | 40 | * @return self instance for chaining.
|
38 | 41 | */
|
39 |
| - default T setLogcatFilterSpecs(String format) { |
| 42 | + default T setLogcatFilterSpecs(List<String> format) { |
40 | 43 | return amend(LOGCAT_FILTER_SPECS_OPTION, format);
|
41 | 44 | }
|
42 | 45 |
|
43 | 46 | /**
|
44 | 47 | * Get the logcat filter format.
|
45 | 48 | *
|
46 |
| - * @return Format specifier. |
| 49 | + * @return Format specifier. See the documentation on {@link #setLogcatFilterSpecs(List)} for more details. |
47 | 50 | */
|
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)); |
50 | 54 | }
|
51 | 55 | }
|
0 commit comments