Skip to content

Commit

Permalink
handle log_file not set
Browse files Browse the repository at this point in the history
  • Loading branch information
rajithkrishnegowda committed Nov 12, 2024
1 parent 3c10020 commit d1864c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion openfl/interface/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ def cli(context, log_level, no_warnings):
# Setup logging immediately to suppress unnecessary warnings on import
# This will be overridden later with user selected debugging level
disable_warnings()
log_file = pathlib.Path(os.getenv("LOG_FILE")).expanduser().resolve()
log_file = os.getenv("LOG_FILE")
if log_file is None:
raise ValueError("LOG_FILE environment variable is not set")

# Normalize the path
log_file = pathlib.Path(log_file).expanduser().resolve()
setup_logging(log_level, log_file)
sys.stdout.reconfigure(encoding="utf-8")

Expand Down

0 comments on commit d1864c2

Please sign in to comment.