mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
23 lines
641 B
Python
23 lines
641 B
Python
import logging as _logging
|
|
|
|
__ALL__ = ["VERBOSE", "TRACE", "RedTraceLogger"]
|
|
|
|
VERBOSE = _logging.DEBUG - 3
|
|
TRACE = _logging.DEBUG - 5
|
|
|
|
|
|
class RedTraceLogger(_logging.getLoggerClass()):
|
|
def __init__(self, name, level=_logging.NOTSET):
|
|
super().__init__(name, level)
|
|
|
|
_logging.addLevelName(VERBOSE, "VERBOSE")
|
|
_logging.addLevelName(TRACE, "TRACE")
|
|
|
|
def verbose(self, msg, *args, **kwargs):
|
|
if self.isEnabledFor(VERBOSE):
|
|
self._log(VERBOSE, msg, args, **kwargs)
|
|
|
|
def trace(self, msg, *args, **kwargs):
|
|
if self.isEnabledFor(TRACE):
|
|
self._log(TRACE, msg, args, **kwargs)
|