Is it possible and what would be the best way to cancel some log entries added via log.debug() after they were added?
I'm trying to not log anything if nothing noteworthy happened in my application (which I only know by the end of my main() loop).
Is it possible and what would be the best way to cancel some log entries added via log.debug() after they were added?
I'm trying to not log anything if nothing noteworthy happened in my application (which I only know by the end of my main() loop).
You can use this piece of code:
logger = logging.getLogger()
logger.disabled = True
## content that WON'T appear in your log file ##
logger.disabled = False
## content that WILL appear in your log file ##
You should take a look here. Maybe you'll find something useful.