os.path.expanduser for logging file name
This commit is contained in:
parent
77ff57eb72
commit
766adcda50
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
from radicale import config
|
from radicale import config
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ level=LEVELS.get(config.get("logging", "level"), logging.NOTSET)
|
|||||||
logger=logging.getLogger("radicale")
|
logger=logging.getLogger("radicale")
|
||||||
logger.setLevel(level=level)
|
logger.setLevel(level=level)
|
||||||
|
|
||||||
handler=logging.FileHandler(config.get("logging", "file"))
|
handler=logging.FileHandler(os.path.expanduser(config.get("logging", "file")))
|
||||||
handler.setLevel(level=level)
|
handler.setLevel(level=level)
|
||||||
|
|
||||||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
||||||
|
Loading…
Reference in New Issue
Block a user