Python Forum

Full Version: module logging posting randomly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I am writing a program with a lot of print() so I use the module logging for debugging purposes. The problem is that when I put logging.debug('some text') in the code, it dumps debugging information when it feels like instead of when it is supposed happen in the code, like a print. How to get my logging behave like a print?
Post your code in python tags. Do you use log from multiple threads? Although you may expect same effects when print from multiple threads
I don't think I use multiple threads.
My code is nothing special, I have an
import logging
at the top
and then a series of
logging.debut('Game engine init ...')
logging.debut('Player one initialised')
And those appear randomly between the print statements that we use for the real game.