A quick question about Python logging format.
logging.basicConfig(filename='test.log', format='%(levelname)s %(message)s', level=logging.DEBUG)
This will give me logging messages like:
INFO Test
What I want now is to add bracket to the level name, like:
[INFO] Test
How should I modify the format argument?
This should do it.
logging.basicConfig(filename='test.log', format='[%(levelname)s] %(message)s', level=logging.DEBUG)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With