From a7d00eb5f34893d06e9c1e8e5b3b3b6656be79a6 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 2 Mar 2010 10:46:48 +0100 Subject: [PATCH] [imp] remove mostly unused DEBUG2 logging level bzr revid: xmo@tinyerp.com-20100302094648-gztszaux31oyfptv --- bin/netsvc.py | 11 +---------- bin/sql_db.py | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index 4a48f540f30..4e3608fa7cf 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -130,16 +130,12 @@ class ExportService(object): LOG_NOTSET = 'notset' LOG_DEBUG_RPC = 'debug_rpc' LOG_DEBUG = 'debug' -LOG_DEBUG2 = 'debug2' LOG_INFO = 'info' LOG_WARNING = 'warn' LOG_ERROR = 'error' LOG_CRITICAL = 'critical' -# add new log level below DEBUG -logging.DEBUG2 = logging.DEBUG - 1 -logging.addLevelName(logging.DEBUG2, 'DEBUG2') -logging.DEBUG_RPC = logging.DEBUG2 - 1 +logging.DEBUG_RPC = logging.DEBUG - 2 logging.addLevelName(logging.DEBUG_RPC, 'DEBUG_RPC') def init_logger(): @@ -200,7 +196,6 @@ def init_logger(): mapping = { 'DEBUG_RPC': ('blue', 'white'), - 'DEBUG2': ('green', 'white'), 'DEBUG': ('blue', 'default'), 'INFO': ('green', 'default'), 'WARNING': ('yellow', 'default'), @@ -226,10 +221,6 @@ class Logger(object): log = logging.getLogger(tools.ustr(name)) - if level == LOG_DEBUG2 and not hasattr(log, level): - fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG2, msg, *args, **kwargs) - setattr(log, LOG_DEBUG2, fct) - if level == LOG_DEBUG_RPC and not hasattr(log, level): fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG_RPC, msg, *args, **kwargs) setattr(log, LOG_DEBUG_RPC, fct) diff --git a/bin/sql_db.py b/bin/sql_db.py index 2cc71408f5c..35492cdceda 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -61,7 +61,7 @@ re_from = re.compile('.* from "?([a-zA-Z_0-9]+)"? .*$'); re_into = re.compile('.* into "?([a-zA-Z_0-9]+)"? .*$'); -def log(msg, lvl=netsvc.LOG_DEBUG2): +def log(msg, lvl=netsvc.LOG_DEBUG): logger = netsvc.Logger() logger.notifyChannel('sql', lvl, msg)