Skip to content

Commit

Permalink
check config load in start_logging
Browse files Browse the repository at this point in the history
Co-authored-by: Jeffrey Martin <[email protected]>
Signed-off-by: Leon Derczynski <[email protected]>
  • Loading branch information
leondz and jmartin-tech authored Jul 30, 2024
1 parent 49bc1eb commit 0cad75c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions garak/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

def start_logging():
from garak import _config
if not _config.loaded:
raise RuntimeError("Configuration must be loaded to start logging!")

logging.basicConfig(
filename=_config.transient.data_dir / "garak.log",
Expand Down

0 comments on commit 0cad75c

Please sign in to comment.