-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.py
42 lines (23 loc) · 833 Bytes
/
log.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# wykys 2018
from rich import print
from sys import stderr
def err(s: str = '') -> None:
print(f'[bold red]ERROR: {s}[/]', file=stderr)
def war(s: str = '') -> None:
print(f'[bold yellow]WARNING: {s}[/]', file=stderr)
def ok(s: str = '') -> None:
print(f'[bold green]OK: {s}[/]')
def stdo(s: str = '') -> None:
print(f'[bold white]{s}[/]')
def cmd(s: str = '') -> None:
print(f'[bold cyan]CMD: {s}[/]')
def rx(s: str = '', prompt: bool = True) -> None:
print(f'\r[bold violet]RX: {s}[/]', end='')
if prompt:
print('\n[bold blue]>>> ', end='')
def tx(s: str = '') -> None:
print(f'[bold green]TX: {s}[/]')
def measurement(s: str = '') -> None:
print(f'[bold dark_orange]MEAS: {s}[/]')
def prompt(s: str = '') -> None:
print(f'[bold green_yellow]{s}[/] >>> ', end='')