Files
fastapi-best-architecture/backend/utils/console.py
T
Wu Clan 0bd41a9e67 Optimize the CLI command console output style (#1094)
* Optimize the CLI command console output style

* Update output functions

* Update destroy sql style
2026-03-05 18:36:44 +08:00

29 lines
752 B
Python

from rich.console import Console
class CustomConsole(Console):
"""自定义控制台"""
def note(self, msg: str) -> None:
"""输出注释"""
self.print(f'[bold white]•[/] [white]{msg}[/]')
def info(self, msg: str) -> None:
"""输出信息"""
self.print(f'[bold cyan]•[/] {msg}')
def tip(self, msg: str) -> None:
"""输出提示消息"""
self.print(f'[bold green]✓[/] [green]{msg}[/]')
def warning(self, msg: str) -> None:
"""输出警告消息"""
self.print(f'[bold yellow]⚠[/] [yellow]{msg}[/]')
def caution(self, msg: str) -> None:
"""输出危险消息"""
self.print(f'[bold red]✗[/] [red]{msg}[/]')
console = CustomConsole()