Skip to content

Commit

Permalink
fix(cli): fix misuse of logger
Browse files Browse the repository at this point in the history
  • Loading branch information
maugde committed Aug 19, 2024
1 parent f342e08 commit bd51be0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/antares_web_installer/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import sys
import typing as t
from pathlib import Path

Expand Down Expand Up @@ -46,16 +45,16 @@ def install_cli(src_dir: t.Union[str, Path], target_dir: t.Union[str, Path], **k
cli_logger.setFormatter(logging.Formatter("[%(asctime)-15s] %(message)s"))
logger.addHandler(cli_logger)

cli_logger.info(f"Starting installation in directory: '{target_dir}'...")
logger.info(f"Starting installation in directory: '{target_dir}'...")
app = App(source_dir=src_dir, target_dir=target_dir, **kwargs)
try:
app.run()
except InstallError as e:
# Display only the error message without traceback
cli_logger.error(e)
logger.error(e)
raise SystemExit(1)
except KeyboardInterrupt:
cli_logger.error("Installation interrupted.")
logger.error("Installation interrupted.")
raise SystemExit(1)

logger.info("Done.")

0 comments on commit bd51be0

Please sign in to comment.