mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Resolve logging configuration file when logging is started
This commit is contained in:
parent
de1e57081b
commit
ada23997a9
1 changed files with 4 additions and 4 deletions
|
@ -33,14 +33,14 @@ from . import config
|
||||||
|
|
||||||
|
|
||||||
LOGGER = logging.getLogger()
|
LOGGER = logging.getLogger()
|
||||||
FILENAME = os.path.expanduser(config.get("logging", "config"))
|
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
|
filename = os.path.expanduser(config.get("logging", "config"))
|
||||||
|
|
||||||
"""Start the logging according to the configuration."""
|
"""Start the logging according to the configuration."""
|
||||||
if os.path.exists(FILENAME):
|
if os.path.exists(filename):
|
||||||
# Configuration taken from file
|
# Configuration taken from file
|
||||||
logging.config.fileConfig(FILENAME)
|
logging.config.fileConfig(filename)
|
||||||
else:
|
else:
|
||||||
# Default configuration, standard output
|
# Default configuration, standard output
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
handler = logging.StreamHandler(sys.stdout)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue