Unverified Commit 890ad462 authored by David Hoese's avatar David Hoese
Browse files

Fix hacky logging level addition

parent 7f59db75
......@@ -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
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__)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment