Reputation: 145
My objective:
I found logging.handlers.MemoryHandler class: https://docs.python.org/2/library/logging.handlers.html#memoryhandler
It partly fits my purpose. It buffers all messages and flushes them whenever an error-level message appears. But if there is no error-message, it won't log anything at all.
I want my app to still log INFOs and WARNINGs if there were no error.
What's the best way to implement that?
Upvotes: 0
Views: 85
Reputation: 5658
The way I see it you can achieve something similar by configuring two loggers.
As an example see the documentation
You can decide how to log them, same file (maybe) or separate files (my-simple.log and my-detailed.log)
Upvotes: 1