Skip to content

Commit

Permalink
style: use debug messages, log less stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Oct 23, 2024
1 parent bc0387b commit 2961ba0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions craft_application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def _merge_defaults(
if not app_commands:
return default_commands

craft_cli.emit.trace(f"Merging commands for group {default_commands.name!r}.")
craft_cli.emit.debug(f"Merging commands for group {default_commands.name!r}:")

# for lookup of commands by name
app_commands_dict = {command.name: command for command in app_commands.commands}
Expand All @@ -237,12 +237,13 @@ def _merge_defaults(
# prefer the application command if it exists
command_name = default_command.name
if command_name in app_commands_dict:
craft_cli.emit.trace(f"Using application command for {command_name!r}.")
craft_cli.emit.debug(
f" - using application command for {command_name!r}."
)
merged_commands.append(app_commands_dict[command_name])
processed_command_names.add(command_name)
# otherwise use the default
else:
craft_cli.emit.trace(f"Using default command for {command_name!r}.")
merged_commands.append(default_command)

# append remaining commands from the application
Expand Down

0 comments on commit 2961ba0

Please sign in to comment.