# HG changeset patch # User Sylvain Thenault # Date 1228494399 -3600 # Node ID 0e031b66cb0b556197d897c0957575a3ff3da0a0 # Parent f6be0c92fc387320766c7b2f3626333eb0ca8d2a don't systematically init_log, it may breaks client log configuration diff -r f6be0c92fc38 -r 0e031b66cb0b cwvreg.py --- a/cwvreg.py Fri Dec 05 17:25:45 2008 +0100 +++ b/cwvreg.py Fri Dec 05 17:26:39 2008 +0100 @@ -27,9 +27,10 @@ class CubicWebRegistry(VRegistry): """extend the generic VRegistry with some cubicweb specific stuff""" - def __init__(self, config, debug=None): - # first init log service - config.init_log(debug=debug) + def __init__(self, config, debug=None, initlog=True): + if initlog: + # first init log service + config.init_log(debug=debug) super(CubicWebRegistry, self).__init__(config) self.schema = None self.reset() @@ -342,6 +343,7 @@ 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 diff -r f6be0c92fc38 -r 0e031b66cb0b dbapi.py --- a/dbapi.py Fri Dec 05 17:25:45 2008 +0100 +++ b/dbapi.py Fri Dec 05 17:26:39 2008 +0100 @@ -74,7 +74,8 @@ 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, + initlog=True): """Constructor for creating a connection to the CubicWeb repository. Returns a Connection object. @@ -97,9 +98,9 @@ vreg = repo.vreg elif setvreg: if mulcnx: - vreg = MulCnxCubicWebRegistry(config) + vreg = MulCnxCubicWebRegistry(config, initlog=initlog) else: - vreg = CubicWebRegistry(config) + vreg = CubicWebRegistry(config, initlog=initlog) vreg.set_schema(repo.get_schema()) else: vreg = None