Commit 13175c50 authored by Sylvain Thenault's avatar Sylvain Thenault
Browse files

don't systematically init_log, it may breaks client log configuration

parent f6be0c92fc38
......@@ -27,9 +27,10 @@ class RaiseCursor:
class CubicWebRegistry(VRegistry):
"""extend the generic VRegistry with some cubicweb specific stuff"""
def __init__(self, config, debug=None):
# first init log service
def __init__(self, config, debug=None, initlog=True):
if initlog:
# first init log service
super(CubicWebRegistry, self).__init__(config)
self.schema = None
......@@ -342,6 +343,7 @@ class CubicWebRegistry(VRegistry):
return RQLHelper(self.schema,
special_relations={'eid': 'uid', 'has_text': 'fti'})
class MulCnxCubicWebRegistry(CubicWebRegistry):
"""special registry to be used when an application has to deal with
connections to differents repository. This class add some additional wrapper
......@@ -74,7 +74,8 @@ def repo_connect(repo, user, password, cnxprops=None):
return cnx
def connect(database=None, user=None, password=None, host=None,
group=None, cnxprops=None, port=None, setvreg=True, mulcnx=True):
group=None, cnxprops=None, port=None, setvreg=True, mulcnx=True,
"""Constructor for creating a connection to the CubicWeb repository.
Returns a Connection object.
......@@ -97,9 +98,9 @@ def connect(database=None, user=None, password=None, host=None,
vreg = repo.vreg
elif setvreg:
if mulcnx:
vreg = MulCnxCubicWebRegistry(config)
vreg = MulCnxCubicWebRegistry(config, initlog=initlog)
vreg = CubicWebRegistry(config)
vreg = CubicWebRegistry(config, initlog=initlog)
vreg = None
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