This commit is contained in:
1 parent
7fa6ae9267
commit
102a6a9969
1 file changed
+5
-1
@@ -77,12 +77,16 @@ def setup_logging(
|
||||
logfile_data = "No Logfile"
|
||||
if logfile:
|
||||
ext = Path(logfile).suffix
|
||||
|
||||
if not ext:
|
||||
ext = ".log"
|
||||
logfile_name = f"{logfile}_{datetime.now():%Y%m%d_%H%M%S}{ext}"
|
||||
if no_date:
|
||||
logfile_name = f"{logfile}{ext}"
|
||||
logfile_data = Path("/home/lucas/logs/") / logfile_name
|
||||
|
||||
logfile_dir = Path.home() / "logs"
|
||||
logfile_dir.mkdir(exist_ok=True, parents=True)
|
||||
logfile_data = logfile_dir/ logfile_name
|
||||
|
||||
file_handler = logging.FileHandler(logfile_data, encoding="utf-8")
|
||||
file_handler.setFormatter(file_formatter)
|
||||
|
||||
Reference in new issue
Block a user