Python Forum
module logging posting randomly
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
module logging posting randomly
#1
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?
Reply
#2
Post your code in python tags. Do you use log from multiple threads? Although you may expect same effects when print from multiple threads
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyaudio seems to randomly halt input. elpidiovaldez5 2 311 Jan-22-2024, 09:07 AM
Last Post: elpidiovaldez5
  Problem with code / audio is playing randomly, not matching csv requirements Daniel_kcr 2 578 Sep-07-2023, 05:09 PM
Last Post: deanhystad
  Python loop for posting data to web marciokoko 10 1,477 Aug-26-2023, 02:17 AM
Last Post: deanhystad
  how to take a screnshot by Pyautogui automatically and randomly rachidel07 0 3,482 Feb-03-2021, 01:16 PM
Last Post: rachidel07
  Problem posting image to clipboard noel 0 2,125 Sep-26-2020, 10:50 AM
Last Post: noel
  logging: child module unable to get parent config jerryxiao 3 3,304 Apr-09-2019, 04:17 AM
Last Post: jerryxiao
  Can I search from Python, automatically and randomly generated keywords in Google? xX_Prophit_Xx 0 2,269 Sep-07-2018, 04:43 PM
Last Post: xX_Prophit_Xx
  Python seems to be randomly blowing up parmort 6 3,192 Aug-22-2018, 09:47 PM
Last Post: parmort
  Posting zip file on HTTP network using Python2.7 deepti92 1 6,748 May-15-2018, 12:41 PM
Last Post: deepti92
  Randomly changing numbers NicoConti 4 3,375 Mar-27-2018, 03:07 PM
Last Post: NicoConti

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020