-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Align logging usage to python logging best practices #245
Conversation
In detail: - completely rewrote logger.py to only consider the WDM_LOG_LEVEL environment variable - modified every call to the logging function to adapt to the new structure - didn't change init methods to be backwards-compatible (log_level parameter is ignored) and added comments explaining it Downsides: - Lost the abilty to set a fixed formatter for our logs - Lost the difference in logging levels between microsoft drivers and the others But these downsides can be addressed by the module user, which is now able to properly control logs
Hello @dariopnc! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-03-31 07:11:36 UTC |
@dariopnc some tests have been failed cause of "first line" argument. |
… parameter in logging calls. With the current master version you could have specified the first_line paramter during every logging call, but that would have been ignored for every call other than the one printing the actual first lines. With this version you don't need to specify that parameter at every logging call other than that one.
Codecov Report
@@ Coverage Diff @@
## master #245 +/- ##
==========================================
- Coverage 93.09% 92.75% -0.35%
==========================================
Files 11 11
Lines 478 469 -9
Branches 68 66 -2
==========================================
- Hits 445 435 -10
- Misses 17 18 +1
Partials 16 16
Continue to review full report at Codecov.
|
If log_level not used anymore - we can delete it and make a release note that in new version it has been deleted. |
…og_level parameter in drivers calls
Removed references to log_level as suggested |
@dariopnc i just discovered that all wdm logs have been disappeared. Shouldn't they be enabled by default? |
@aleksandr-kotlyar Thing is logging is enabled, but it's up to the application using this module to configure a logging handler to receive log messages and handle them (add them to a file, print them in the console, send them through SOAP calls, etc) |
@aleksandr-kotlyar To merge this change should I update test cases? Should I wait for someone else to do it? |
Changes to log calls to adequate to the use of a central logger
Use the new object and logging standard functions
@dariopnc thanks for keeping your PR up to date! I think about - how to preprare webdriver-manager users for these changes.
It will be cool if you will help to describe this info in this PR before merge and release it. |
@aleksandr-kotlyar Updated doc as suggested but now I sincerely don't know why test_utils is failing |
Ok, I suppose 9f405f2 from current master is to blame for the issue... actually even current HEAD fails some tests |
Thank you for your work. I fixed test utils in new PR #298. Pull the changes please to resolve conflicts. |
PR updated to current master |
Hi @aleksandr-kotlyar, I've seen #343 significantly modifies the logging structure. I sincerely do not understand why this PR hasn't been considered, instead on adding a new custom behavior. Can you please explain? |
Ref: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
In detail:
Downsides:
These downsides can be addressed by the module user, which is now able to properly control logs
Fixes #209
Closes #210
Fixes #277
Fixes #287