Repository navigation
🔧 Open up logging - #237
Merged
Merged
Conversation
keithrfung
force-pushed
the
feature/open-up-logging
branch
from
October 29, 2020 21:26
c237c9a to
7b5e150
Compare
rkorsak
reviewed
Oct 29, 2020
rkorsak
reviewed
Oct 29, 2020
rkorsak
left a comment
Contributor
There was a problem hiding this comment.
This is my fault, but I'm realizing that we can't put this in the __init__ unless we make deeper changes to our singleton approach.
The library uses the shared LOG instance everywhere, and it's initialized in this file with empty arguments.
I think we may just want to expose a method to add a file handler to an existing logger for now. It wouldn't address the optional file/stream handlers, but it gets us moving at least.
Create methods on logger for add/remove handlers and get all handlers. Expose these in global methods as well on the global instance of LOG. Open up the get methods for file and stream handlers Remove the file logger since it now can be added afterward instead of by default.
'silent' apparently should be without quotes. A warning is thrown on lint.
keithrfung
force-pushed
the
feature/open-up-logging
branch
from
October 30, 2020 14:37
7b5e150 to
f7727ee
Compare
keithrfung
commented
Oct 30, 2020
| super(ElectionGuardLog, self).__init__() | ||
|
|
||
| self.__logger = logging.getLogger("electionguard") | ||
| self.__logger.addHandler(self._get_file_handler()) |
Contributor
Author
There was a problem hiding this comment.
Note: The file handler is removed. It can now be added at any point, but is not the default.
keithrfung
commented
Oct 30, 2020
| disallow_untyped_defs = True | ||
| ignore_missing_imports = True | ||
| follow_imports = "silent" | ||
| follow_imports = silent |
Contributor
Author
There was a problem hiding this comment.
This was throwing a warning on lint. Apparently it does not need quotes.
AddressXception
previously approved these changes
Oct 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #238
Description
Create methods on logger for add/remove handlers and get all handlers. Expose these in global methods as well on the global instance of LOG.
Open up the get methods for file and stream handlers
Remove the file logger since it now can be added afterward instead of by default.
Testing
Checklist
🚨Please review the guidelines for contributing to this repository.
💚Thank you!