diff --git a/openfl/interface/cli.py b/openfl/interface/cli.py index 9bed2d6c91..9937ddea01 100755 --- a/openfl/interface/cli.py +++ b/openfl/interface/cli.py @@ -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")