[tor-commits] [stem/master] Registering TRACE and NOTICE level names

atagar at torproject.org atagar at torproject.org
Thu Jan 5 18:40:50 UTC 2012


commit 228a431b06b2a89182335216b4d9cfce166c6ce9
Author: Damian Johnson <atagar at torproject.org>
Date:   Wed Jan 4 17:34:50 2012 -0800

    Registering TRACE and NOTICE level names
    
    Registering the custom TRACE and NOTICE runlevels with the logging module so
    their names will appear when we log a runlevel.
---
 stem/util/log.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/stem/util/log.py b/stem/util/log.py
index fc4244f..5c5815e 100644
--- a/stem/util/log.py
+++ b/stem/util/log.py
@@ -35,6 +35,9 @@ LOG_VALUES = {
   Runlevel.ERROR: logging.ERROR,
 }
 
+logging.addLevelName(LOG_VALUES[TRACE], "TRACE")
+logging.addLevelName(LOG_VALUES[NOTICE], "NOTICE")
+
 LOGGER = logging.getLogger("stem")
 LOGGER.setLevel(LOG_VALUES[TRACE])
 
@@ -131,4 +134,3 @@ def escape(message):
   
   return message
 
-





More information about the tor-commits mailing list