Skip to content

Commit 43d5983

Browse files
authored
Merge pull request #15 from legend-exp/fix
minor improvement to build_log()
2 parents 512d89c + 75da7e2 commit 43d5983

File tree

1 file changed

+5
-2
lines changed
  • src/legenddataflowscripts/utils

1 file changed

+5
-2
lines changed

src/legenddataflowscripts/utils/log.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ def build_log(
3939
log_file
4040
The path to the log file.
4141
"""
42-
if isinstance(config_dict, str):
42+
if isinstance(config_dict, str | dict):
4343
config_dict = {"options": {"logging": config_dict}}
44+
4445
if "logging" in config_dict["options"]:
4546
log_config = config_dict["options"]["logging"]
46-
log_config = Props.read_from(log_config)
47+
# if it's a str, interpret it as a path to a file
48+
if isinstance(log_config, str):
49+
log_config = Props.read_from(log_config)
4750

4851
if log_file is not None:
4952
Path(log_file).parent.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)