Easy way to temporarily kill logging in Python
Ever want to just turn off that logger for a while in Python? Maybe while running tests or debugging? Even the CRITICAL messages?
Notice that the logging level contants (logging.DEBUG etc) actually represent numeric values:
Level Numeric value
CRITICAL 50
ERROR 40
WARNING 30
INFO 20
DEBUG 10
NOTSET 0
On a whim I tried:
logging.getLogger('logger_to_turn_off').setLevel(100)
And bam, no logging, even the CRITICAL messages. Yes, most of you python nerds knew this, but I didn't, so I learned something at least!
@GlennF talk to #eveonline players for tips on harvesting tears.
Chimay #trippel #notchimay http://t.co/IWHXma6IUK
The #ikea wallet-drain-train. http://t.co/8YUmQvrDuw
Muppet training today. Oh, wait i mean Puppet #puppetflail #thepuppetshow
Reports are coming in that the new Glitch Mob is EPIC #headbangarang #moarbeats #chairdance
monkey-patching like hell #python #patchit
Pre-interview headache and nausea #worklife
Ever want to fly internet spaceships in the biggest universe around? EVE is expanding in mere weeks. https://t.co/KrThsanE4r #eveonline
RT @markboxapp: We'd never tell you to, but if you feel the need to cancel your @markboxapp account, you now can from the account page #i…
Headed to Sedona today with the fan for some sightseeing, hiking #goodtimes
@mattbraun @GlennF @marcoarment Kitchen timer #notinmarcosapp
Also, my plasma torch cuts 5/8" rebar juuuust fine #icantbelieveitsnotbutttet
OH on IRC: "Why's my redbull warm? And I need a prosecco flavored version to match this braised Berkshire Pork Belly #gamerfoodie
Part of the problem, of course, is that I never learned to touch type, then I learned perl #twostrikes
I'll be honest: I appreciate drama but don't really grasp the obsession with violent murdering criminals as heroes #sopranos #breakingbad
At dr for test results, they still take BP etc. Sitting heart rate: 54 #winning
None
logger.debuuuuughh('what the hell
#python #debuglogging
Spotify and Rdio might have better products, but iTunes Radio is plenty good and it lives in my iTunes #notahipster
@sdsolle @glennf No, that's what the plasma torch is for #notwhatitsfor