New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Ruby Logging #11967
Change Ruby Logging #11967
Conversation
I'm looking through https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/, but I don't see what exactly we should match in Ruby. Can you point to Java/Python/etc examples? |
I meant the levels.
Right now I wish Ruby had more "debug" levels like the other languages, but alas. |
# | ||
# @param [Array, Symbol] id | ||
# | ||
def select(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
|
||
warn message, &block | ||
@logger.warn { message } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is very similar to #discard_or_log
. I suggest you refactor it so that it accepts @reject/@select
as the parameters. Then you can simply call this method with an extra :deprecations
id.
I fixed the things you suggested, including changing the names. I'd prefer Arrays to Sets still just because that's what people are more used to... Methods now accept one or more params and Arrays. I also added logic for setting the default level in constructor. Webdrivers gem and Watir both use the Selenium Logger, and don't want to force the change on them? |
My proposal was to convert arrays to sets internally, not to force people into using sets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but CI is failing.
06dec92
to
fb6622f
Compare
…ects can keep existing behavior
the io accessor for the process sets a default value, so assigning with ||= operator will never work
Description
Change default logging level to
:info
and provide more granular filtering optionsMotivation and Context
I'm looking at how logging is being done in other languages, and as part of putting this documentation together - https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/ I thought we should change our implementation to match the other languages.
Details:
To better manage the flood of details now in
:debug
mode, I've added#select
and#reject
methods where you can opt in or opt out of specific types of logs.Let me know if all of these choices make sense.