This commit is contained in:
Will McGugan
2022-09-01 16:00:31 +01:00
parent e71334d6f6
commit 7d3e0c2680
2 changed files with 14 additions and 8 deletions

View File

@@ -2,20 +2,26 @@ from enum import Enum, auto
class LogGroup(Enum):
UNDEFINED = 0
EVENT = auto()
DEBUG = auto()
INFO = auto()
WARNING = auto()
ERROR = auto()
PRINT = auto()
"""A log group is a classification of the log message (*not* a level)."""
UNDEFINED = 0 # Mainly for testing
EVENT = 1
DEBUG = 2
INFO = 3
WARNING = 4
ERROR = 5
PRINT = 6
class LogVerbosity(Enum):
"""Tags log messages as being verbose and potentially excluded from output."""
NORMAL = 0
HIGH = 1
class LogSeverity(Enum):
"""Tags log messages as being more severe."""
NORMAL = 0
CRITICAL = 1

View File

@@ -92,7 +92,7 @@ class DevConsoleLog:
time = local_time.time()
message = Text(
f":warning-emoji: [{time}] {group}"
if self.severity
if self.severity > 0
else f"[{time}] {group}"
)
message.stylize("dim")