Skip to content

Commit

Permalink
Print configuration to shell if no_prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 10, 2024
1 parent d04fa8f commit 887230c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lvmcryo/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@ async def ln2_runner(

log = handler.log

# Record options used.
# Record options used. If in no_promp is False (the default), the full
# configuration has already been printed for confirmation, so we only
# save this with debug level.
config_json = config.model_dump_json(indent=2)
log.debug(f"Running {config.action.value} with configuration:\n{config_json}")
log.log(
logging.INFO if config.no_prompt else logging.DEBUG,
f"Running {config.action.value} with configuration:\n{config_json}",
)

if config.dry_run:
log.warning("Running in dry-run mode. No valves will be operated.")
Expand Down

0 comments on commit 887230c

Please sign in to comment.