[FIX] DONT pformat() each RPC request !

- move import pformat() statement to top of file
  - until now server was doing pformat() for each RPC request before calling
    notifyChannel function. if we wasn't in LOG_DEBUG_RPC level we lost RAM
    and CPU for nothing.

bzr revid: jvo@tinyerp.com-20100514130602-1r3c31tzpz7g0s0x
This commit is contained in:
Elias Hermoso Illera 2010-05-14 18:36:02 +05:30 committed by Jay (Open ERP)
parent 30ba228595
commit 2f0ff7766a
1 changed files with 2 additions and 1 deletions

View File

@ -365,7 +365,8 @@ class OpenERPDispatcherException(Exception):
class OpenERPDispatcher:
def log(self, title, msg):
Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
if tools.config['log_level'] == logging.DEBUG_RPC:
Logger().notifyChannel('%s' % title, LOG_DEBUG_RPC, pformat(msg))
def dispatch(self, service_name, method, params):
try: