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
No related branches found
No related tags found
No related merge requests found
......@@ -36,9 +36,14 @@ from datetime import datetime, timedelta
import serial
# FIXME: bad-joo-joo
logging._levelNames[9] = 'TRACE'
logging._levelNames['TRACE'] = 9
# https://stackoverflow.com/a/13638084/433202
TRACE_LEVEL_NUM = 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__)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment