by
569 14
1
6
219k
1
Top 1% !
Popular
Pearl of Wisdom
Tagged
Specified
OpenSource
Popularity: 6905th place
Languagepython
Languagestylus
LicenseMIT_X11

Get logging config and start logging in Python

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/274644/Get-logging-config-and-start-logging-in-?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
import logging import os.path SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) def main(): log_path = os.path.join(SCRIPT_DIR, 'logging.conf') logging.config.fileConfig(log_path, disable_existing_loggers=False) logger.info("start logging!")
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus