-
Notifications
You must be signed in to change notification settings - Fork 22
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
Test loggers with NOTSET level having the parent level changed after instantiation #22
Comments
I might be missing something but even the standard library logging doesn't assert this: def test_case():
logger = logging.Logger("test")
logger.parent = logging.Logger("parent", logging.WARNING)
stream = io.StringIO()
handler = logging.StreamHandler(stream)
logger.addHandler(handler)
logger.log(logging.DEBUG, "Hello World")
assert stream.getvalue() == ""
logger.parent.setLevel(logging.DEBUG)
logger.log(logging.DEBUG, "Hello World")
assert stream.getvalue() == "Hello World\n" # Failing And then the test with picologging has the same behaviour and does not pass either. |
I've actually added the suggested situation in my latest PR, https://github.com/microsoft/picologging/pull/108/files#diff-7c31002b037ae4bc2888350bb25d9b9621c6aff7e98d6e6871a8a649d088e27bR516 |
Change merged! |
Assert that:
NOTSET
WARNING
DEBUG
message that is not handledDEBUG
DEBUG
message in the child that IS handledThe text was updated successfully, but these errors were encountered: