Skip to content
Snippets Groups Projects
Unverified Commit 890ad462 authored by David Hoese's avatar David Hoese
Browse files

Fix hacky logging level addition

parent 7f59db75
Branches
No related tags found
No related merge requests found
...@@ -36,9 +36,14 @@ from datetime import datetime, timedelta ...@@ -36,9 +36,14 @@ from datetime import datetime, timedelta
import serial import serial
# FIXME: bad-joo-joo # https://stackoverflow.com/a/13638084/433202
logging._levelNames[9] = 'TRACE' TRACE_LEVEL_NUM = 9
logging._levelNames['TRACE'] = 9 logging.addLevelName(TRACE_LEVEL_NUM, "TRACE")
def debugv(self, message, *args, **kws):
# Yes, logger takes its '*args' as 'args'.
if self.isEnabledFor(TRACE_LEVEL_NUM):
self._log(TRACE_LEVEL_NUM, message, args, **kws)
logging.Logger.debugv = debugv
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment