Skip to content
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

set_global_log_level: surprising behavior #179

Open
oberstet opened this issue May 5, 2022 · 0 comments
Open

set_global_log_level: surprising behavior #179

oberstet opened this issue May 5, 2022 · 0 comments

Comments

@oberstet
Copy link
Contributor

oberstet commented May 5, 2022

considering

import txaio
txaio.use_twisted()

log = txaio.make_logger()

print('print 1')
log.info('info 1')
log.warn('warn 1')

txaio.start_logging(level='warn')

print('print 2')
log.info('info 2')
log.warn('warn 2')

txaio.set_global_log_level(level='info')

print('print 3')
log.info('info 3')
log.warn('warn 3')

this prints

(cpy39_1) (base) oberstet@intel-nuci7:$ python foo.py 
print 1
2022-05-05T18:26:37+0200 warn 1
2022-05-05T18:26:37+0200 warn 2
2022-05-05T18:26:37+0200 warn 3

I think this should print

...
2022-05-05T18:26:37+0200 warn 2
2022-05-05T18:26:37+0200 print 3
2022-05-05T18:26:37+0200 info 3
2022-05-05T18:26:37+0200 warn 3

Not sure .. how do I use set_global_log_level properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant