-
Notifications
You must be signed in to change notification settings - Fork 421
fix(logger): test generates logfile #971
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
Conversation
Currently test_copy_config_to_ext_loggers_clean_old_handlers creates a file called "logfile"
@heitorlessa - So this is why :) |
Codecov Report
@@ Coverage Diff @@
## develop #971 +/- ##
========================================
Coverage 99.96% 99.96%
========================================
Files 119 119
Lines 5335 5335
Branches 607 607
========================================
Hits 5333 5333
Partials 2 2 Continue to review full report at Codecov.
|
@mploski - I assume for the tests I can replace |
@mploski could you clarify what this test tests? I'm not entirely sure, perhaps what the |
thats correct @michaelbrewer we can use nullhandler or stream handler for example |
|
@mploski @heitorlessa - is this PR cool as it is? Or are there other changes needed? |
Looks good to me :) |
@heitorlessa - anything outstanding? |
Michal comes back from PTO tomorrow and will make suggestions to fix his test comments to make the intent clearer - then we can merge (instead of creating another PR after merging this) |
@michaelbrewer I reviewed test's comments I added some time ago for these tests and definitely I could have made them better :-) If you could tune them that would be great! Here are some suggestions, feel free to modify it :-) test_copy_config_to_ext_loggers test_copy_config_to_ext_loggers_include test_copy_config_to_ext_loggers_wrong_include test_copy_config_to_ext_loggers_exclude test_copy_config_to_ext_loggers_include_exclude test_copy_config_to_ext_loggers_clean_old_handlers test_copy_config_to_ext_loggers_custom_log_level |
Cool @mploski all done. |
logger = logger() | ||
powertools_logger = Logger(service=service_name(), level=log_level.INFO.value, stream=stdout) | ||
|
||
# WHEN configuration copied from powertools logger to ALL external loggers AND our external logger used | ||
# THEN included external loggers used Powertools handler, formatter and log level. |
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.
Shouldn't it be something like WHEN configuration copied from powertools logger to INCLUDED NON EXISTING external loggers
?
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.
Looks great! Let's merge it
Issue #, if available:
Description of changes:
isinstance
overtype
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.