Skip to content

Commit 23af222

Browse files
committed
another attempt
1 parent 90935a0 commit 23af222

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autointent/_logging/setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ def setup_logging(level: LogLevel | str, log_filename: Path | str | None = None)
2828

2929
if log_filename is not None:
3030
config["loggers"]["root"]["handlers"].append("file")
31+
32+
filename = str(log_filename) + ".log.jsonl"
3133
config["handlers"]["file"] = {
3234
"class": "logging.FileHandler",
3335
"level": "DEBUG",
3436
"formatter": "json",
35-
"filename": str(log_filename) + ".log.jsonl",
37+
"filename": filename,
3638
}
39+
Path(filename).parent.mkdir(parents=True, exist_ok=True)
3740

3841
logging.config.dictConfig(config)

0 commit comments

Comments
 (0)