Skip to content

Commit

Permalink
logging.py: Make time_str optional
Browse files Browse the repository at this point in the history
If `time_str` is empty, it shouldn't add a space to the list of parts.
  • Loading branch information
KrystalDelusion authored and jix committed Apr 15, 2024
1 parent 652975b commit a4de2fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/yosys_mau/task_loop/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def default_formatter(event: LogEvent):
parts: list[str] = []
if context.app_name:
parts.append(f"{click.style(context.app_name, fg='blue')} ")
parts.append(f"{click.style(time_str, fg='green')} ")
if time_str:
parts.append(f"{click.style(time_str, fg='green')} ")
if context.work_dir:
parts.append(f"[{click.style(context.work_dir, fg='blue')}] ")
if context.scope:
Expand Down

0 comments on commit a4de2fa

Please sign in to comment.