Commit b2b193ce authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Romain Bignon

weboob.core: add parent logger param when instanciating a module

parent 5cbf90b7
......@@ -89,8 +89,8 @@ class LoadedModule(object):
return True
return False
def create_instance(self, weboob, backend_name, config, storage, nofail=False):
backend_instance = self.klass(weboob, backend_name, config, storage, self.logger, nofail)
def create_instance(self, weboob, backend_name, config, storage, nofail=False, logger=None):
backend_instance = self.klass(weboob, backend_name, config, storage, logger=logger or self.logger, nofail=nofail)
self.logger.debug(u'Created backend "%s" for module "%s"' % (backend_name, self.name))
return backend_instance
......
......@@ -89,7 +89,7 @@ class WebNip(object):
"""
self.unload_backends()
def build_backend(self, module_name, params=None, storage=None, name=None, nofail=False):
def build_backend(self, module_name, params=None, storage=None, name=None, nofail=False, logger=None):
"""
Create a backend.
......@@ -109,7 +109,7 @@ class WebNip(object):
"""
module = self.modules_loader.get_or_load_module(module_name)
backend_instance = module.create_instance(self, name or module_name, params or {}, storage, nofail)
backend_instance = module.create_instance(self, name or module_name, params or {}, storage, nofail, logger=logger or self.logger)
return backend_instance
class LoadError(Exception):
......
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