Skip to content

Add ability to filter log entries by range of log levels#5667

Closed
valfirst wants to merge 1 commit intoSeleniumHQ:masterfrom
valfirst:filter-log-entries-by-level-range
Closed

Add ability to filter log entries by range of log levels#5667
valfirst wants to merge 1 commit intoSeleniumHQ:masterfrom
valfirst:filter-log-entries-by-level-range

Conversation

@valfirst
Copy link
Copy Markdown
Contributor

@valfirst valfirst commented Mar 22, 2018


This change is Reviewable

@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from 8fe5f9b to d2736ab Compare March 23, 2018 06:39
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from d2736ab to 71dd17a Compare April 17, 2018 19:54
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from 71dd17a to 2fd6984 Compare April 26, 2018 11:31
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch 2 times, most recently from acab905 to 2afed0b Compare May 20, 2018 11:59
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from 2afed0b to 0443eca Compare May 25, 2018 08:44
@lmtierney lmtierney added the C-java Java Bindings label May 30, 2018
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from 0443eca to ffeaf98 Compare June 6, 2018 19:14
@shs96c
Copy link
Copy Markdown
Member

shs96c commented Jun 15, 2018

Would it not be nicer to pass in a Predicate<LogEntry>? That way you can just use a normal Java streams to deal with these.

@shs96c
Copy link
Copy Markdown
Member

shs96c commented Jun 15, 2018

Looking closer, LogEntries.getAll().stream().filter(entry -> true).collect(Collectors.toList()) would allow this, right? And then it becomes easier to add your own filters too.

@shs96c shs96c added the J-awaiting answer Question asked of user; a reply moves it to triage again label Jun 15, 2018
@valfirst
Copy link
Copy Markdown
Contributor Author

Would it not be nicer to pass in a Predicate? That way you can just use a normal Java streams to deal with these.

I can make private List<LogEntry> filter(Predicate<LogEntry> logEntryPredicate) public. Or do you propose to do not add methods filtering by levels at all?


The root cause of this PR: I've started using LogEntries, applied filter(Level.WARNING) and expected to get only warnings (who reads javadocs 😄), but I received warnings, errors and etc. So I thought, that it might be useful to have flexible API to get log entries of specified level or level range only, at least users may try to understand difference between overloaded methods.

@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from ffeaf98 to fe369b4 Compare June 26, 2018 20:43
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from fe369b4 to 38994ca Compare July 11, 2018 21:31
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from 38994ca to 14801b9 Compare August 4, 2018 20:21
@valfirst valfirst force-pushed the filter-log-entries-by-level-range branch from 14801b9 to e97ff13 Compare August 5, 2018 08:15
@valfirst
Copy link
Copy Markdown
Contributor Author

valfirst commented Oct 8, 2018

Closing: filter functionality was deprecated in LogEntries: c24ac7c

@valfirst valfirst closed this Oct 8, 2018
@valfirst valfirst deleted the filter-log-entries-by-level-range branch October 8, 2018 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-java Java Bindings J-awaiting answer Question asked of user; a reply moves it to triage again

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants