Amir Katz
Amir Katz

Reputation: 673

Python logbook - how to dynamically control logging level

I have recently switched from using 'logging' to 'logbook'.
So far, so good, but I am missing one critical functionality - ability to change the minimum level during runtime.
In 'logging', I can call myLogger.setLevel(logging.INFO), but there is no equivalent method in logbook.
Anyone?

Upvotes: 3

Views: 1557

Answers (1)

Amir Katz
Amir Katz

Reputation: 673

Very simple (and undocumented) - modify the 'level' attribute:
myLogger.level = logbook.INFO

Upvotes: 5

Related Questions