[FIX] logging capture when testing embedded in server, handler hooks are more complex than through oe

bzr revid: xmo@openerp.com-20130403135849-ufnn2a1hdu938p7p
This commit is contained in:
Xavier Morel 2013-04-03 15:58:49 +02:00
parent ebc1cb227d
commit 3df2a146cd
1 changed files with 3 additions and 3 deletions

View File

@ -65,8 +65,8 @@ class TestHandler(logging.handlers.BufferingHandler):
return False
@contextlib.contextmanager
def capture_logging(level=logging.DEBUG):
logger = logging.getLogger('openerp.addons.web')
def capture_logging(logger, level=logging.DEBUG):
logger = logging.getLogger(logger)
old_level = logger.level
old_handlers = logger.handlers
old_propagate = logger.propagate
@ -257,7 +257,7 @@ class TestSubclassing(DispatchCleanup):
def speak(self):
return 'Yu ordered cheezburgerz,'
with capture_logging() as handler:
with capture_logging('openerp.addons.web.http') as handler:
class DogController(CatController):
_cp_path = '/dog'