Skip to content

Commit

Permalink
fix filesystem path, filename manipulation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rajithkrishnegowda committed Nov 8, 2024
1 parent d4c97b3 commit d5c0503
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions openfl/interface/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,17 @@ def format_help(self, ctx, formatter):
@group(cls=CLI)
@option("-l", "--log-level", default="info", help="Logging verbosity level.")
@option("--no-warnings", is_flag=True, help="Disable third-party warnings.")
@option("--log-file", default="logs/app.log", help="Path to the log file.")
@pass_context
def cli(context, log_level, no_warnings):
def cli(context, log_level, no_warnings, log_file):
"""
Command-line Interface.
Args:
context (click.core.Context): Click context.
log_level (str): Logging verbosity level.
no_warnings (bool): Flag to disable third-party warnings.
log_file (str): Path to the log file.
"""

context.ensure_object(dict)
Expand All @@ -181,7 +183,6 @@ 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 = os.getenv("LOG_FILE")
# Validate log_file with tighter restrictions
if log_file:
log_file = os.path.normpath(log_file)
Expand Down Expand Up @@ -343,4 +344,4 @@ def entry():


if __name__ == "__main__":
entry()
entry()

0 comments on commit d5c0503

Please sign in to comment.