Explorar el Código

os.path.expanduser for logging file name

System User hace 15 años
padre
commit
766adcda50
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      radicale/log.py

+ 2 - 1
radicale/log.py

@@ -2,6 +2,7 @@
 
 import sys
 import logging
+import os
 
 from radicale import config
 
@@ -16,7 +17,7 @@ level=LEVELS.get(config.get("logging", "level"), logging.NOTSET)
 logger=logging.getLogger("radicale")
 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)
 		
 formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")