Python Forum
Logging module stopped working!
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Logging module stopped working!
#2
For anyone who read the above post and also didn't know a solution, I now understand it better.  The truth is that "downstream modules" really aren't so downstream after all.  The modules I imported prior to MainWindow() being called all get parsed to at least some extent, and in one of those local modules I had a call to logging.info() that was placed prior to the __init__() function of a class.  The parser apparently tried to process it, but because the configuration command for logging does't get called until I'm in MainWindow.__init__(), it couldn't do anything with it.  I wish this kind of thing wasn't a silent failure, but it is.

The solution was to move the import logging command to higher up in the list, and follow it immediately with the logging.basicConfig() command before any of the local modules get imported.

That gives you a lot more flexibility on where to place your other calls to the logging module.
Reply


Messages In This Thread
Logging module stopped working! - by llanitedave - Oct-17-2017, 04:14 AM
RE: Logging module stopped working! - by llanitedave - Oct-18-2017, 06:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  working with TLV module Object Jennifer_Jone 3 1,193 Mar-14-2023, 07:54 PM
Last Post: Jennifer_Jone
  Unsure why module is not working garynewport 0 786 Feb-15-2023, 03:21 PM
Last Post: garynewport
  Pandas module not working Hass 2 1,765 Apr-14-2022, 03:13 PM
Last Post: snippsat
  Spyder stopped working in Windows 10 gammaray 3 3,103 Apr-19-2021, 05:33 PM
Last Post: jefsummers
  importing module - not working jdhamblett 3 3,062 Jun-22-2020, 07:33 PM
Last Post: jdhamblett
  Python logging RotatingFileHandler and TimedRotatingFileHandler is not working with Q waytosatyam7 2 4,840 Dec-24-2019, 08:44 AM
Last Post: buran
  setup() from turtle module not working bobfat 7 6,253 Oct-28-2019, 11:05 AM
Last Post: newbieAuggie2019
  pyinstaller not working with acoustics module pynz 2 2,811 Oct-08-2019, 07:56 AM
Last Post: pynz
  module logging posting randomly DJ_Qu 2 2,246 May-14-2019, 06:41 AM
Last Post: DJ_Qu
  logging: child module unable to get parent config jerryxiao 3 3,404 Apr-09-2019, 04:17 AM
Last Post: jerryxiao

Forum Jump:

User Panel Messages

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