mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-24 03:34:18 +01:00
Overhaul in printing using rich
This commit is contained in:
@@ -4,7 +4,7 @@ from rich.theme import Theme
|
||||
from rich.style import Style
|
||||
|
||||
|
||||
custom_theme = Theme({"info": "blue", "error": "bold red"})
|
||||
custom_theme = Theme({"info": "bold blue", "error": "bold red", "debug": "bold blue"})
|
||||
console = Console(theme=custom_theme)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def info(
|
||||
markup=markup,
|
||||
highlight=highlight,
|
||||
log_locals=log_locals,
|
||||
_stack_offset=_stack_offset,
|
||||
_stack_offset=_stack_offset + 1,
|
||||
)
|
||||
|
||||
|
||||
@@ -58,5 +58,32 @@ def error(
|
||||
markup=markup,
|
||||
highlight=highlight,
|
||||
log_locals=log_locals,
|
||||
_stack_offset=_stack_offset,
|
||||
_stack_offset=_stack_offset + 1,
|
||||
)
|
||||
|
||||
|
||||
def debug(
|
||||
*objects: Any,
|
||||
sep: str = " ",
|
||||
end: str = "\n",
|
||||
style: Optional[Union[str, Style]] = None,
|
||||
justify: Optional[JustifyMethod] = None,
|
||||
emoji: Optional[bool] = None,
|
||||
markup: Optional[bool] = None,
|
||||
highlight: Optional[bool] = None,
|
||||
log_locals: bool = False,
|
||||
_stack_offset: int = 1,
|
||||
):
|
||||
console.log(
|
||||
"[debug]DEBUG[/debug]",
|
||||
*objects,
|
||||
sep=sep,
|
||||
end=end,
|
||||
style=style,
|
||||
justify=justify,
|
||||
emoji=emoji,
|
||||
markup=markup,
|
||||
highlight=highlight,
|
||||
log_locals=log_locals,
|
||||
_stack_offset=_stack_offset + 1,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user