Add a `log.devx()` level

runtime_to_msgspec
Tyler Goodlet 2024-04-30 11:47:26 -04:00
parent 979af79588
commit f139adddca
1 changed files with 16 additions and 3 deletions

View File

@ -53,6 +53,7 @@ LEVELS: dict[str, int] = {
'RUNTIME': 15, 'RUNTIME': 15,
'CANCEL': 16, 'CANCEL': 16,
'PDB': 500, 'PDB': 500,
'DEVX': 500,
} }
# _custom_levels: set[str] = { # _custom_levels: set[str] = {
# lvlname.lower for lvlname in LEVELS.keys() # lvlname.lower for lvlname in LEVELS.keys()
@ -62,6 +63,7 @@ STD_PALETTE = {
'CRITICAL': 'red', 'CRITICAL': 'red',
'ERROR': 'red', 'ERROR': 'red',
'PDB': 'white', 'PDB': 'white',
'DEVX': 'cyan',
'WARNING': 'yellow', 'WARNING': 'yellow',
'INFO': 'green', 'INFO': 'green',
'CANCEL': 'yellow', 'CANCEL': 'yellow',
@ -86,7 +88,8 @@ class StackLevelAdapter(logging.LoggerAdapter):
) -> None: ) -> None:
''' '''
IPC level msg-ing. IPC transport level msg IO; generally anything below
`._ipc.Channel` and friends.
''' '''
return self.log(5, msg) return self.log(5, msg)
@ -102,7 +105,7 @@ class StackLevelAdapter(logging.LoggerAdapter):
msg: str, msg: str,
) -> None: ) -> None:
''' '''
Cancellation logging, mostly for runtime reporting. Cancellation sequencing, mostly for runtime reporting.
''' '''
return self.log( return self.log(
@ -116,7 +119,17 @@ class StackLevelAdapter(logging.LoggerAdapter):
msg: str, msg: str,
) -> None: ) -> None:
''' '''
Debugger logging. `pdb`-REPL (debugger) related statuses.
'''
return self.log(500, msg)
def devx(
self,
msg: str,
) -> None:
'''
"Developer experience" sub-sys statuses.
''' '''
return self.log(500, msg) return self.log(500, msg)