Skip to content

Commit

Permalink
Improved styling of logging
Browse files Browse the repository at this point in the history
Extends the theme to assure that:
- success lines are displayed with bold green
- critical errors are not using inverted text
- debug is dimmed
- other values are copied from rich defaults
  • Loading branch information
ssbarnea committed Oct 31, 2020
1 parent 721dac5 commit fcb0041
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/molecule/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any

from rich.console import Console
from rich.style import Style
from rich.theme import Theme

theme = Theme(
Expand All @@ -13,6 +14,13 @@
"danger": "bold red",
"scenario": "green",
"action": "green",
"logging.level.notset": Style(dim=True),
"logging.level.debug": Style(color="white", dim=True),
"logging.level.info": Style(color="blue"),
"logging.level.warning": Style(color="red"),
"logging.level.error": Style(color="red", bold=True),
"logging.level.critical": Style(color="red", bold=True),
"logging.level.success": Style(color="green", bold=True),
}
)

Expand Down

0 comments on commit fcb0041

Please sign in to comment.