# HG changeset patch # User domruf # Date 1494344971 -7200 # Node ID 5b3568c99cc317848428a28ad7c0a36cb6af440e # Parent ff287676b206c156e5712e299d2762cc9b710f35 sqlalchemy: remove echo setting from .ini files and create_engine Instead of 'echo' the normal logging configration should be used. Follow the advice from https://docs.sqlalchemy.org/en/rel_1_1/core/engines.html#configuring-logging which says "when using Python logging, ensure all echo flags are set to False at all times". diff -r ff287676b206 -r 5b3568c99cc3 development.ini --- a/development.ini Wed Apr 26 11:21:56 2017 +0300 +++ b/development.ini Tue May 09 17:49:31 2017 +0200 @@ -503,7 +503,6 @@ # see sqlalchemy docs for others -sqlalchemy.echo = false sqlalchemy.pool_recycle = 3600 ################################ diff -r ff287676b206 -r 5b3568c99cc3 kallithea/lib/db_manage.py --- a/kallithea/lib/db_manage.py Wed Apr 26 11:21:56 2017 +0300 +++ b/kallithea/lib/db_manage.py Tue May 09 17:49:31 2017 +0200 @@ -63,12 +63,11 @@ class DbManage(object): - def __init__(self, log_sql, dbconf, root, tests=False, SESSION=None, cli_args=None): + def __init__(self, dbconf, root, tests=False, SESSION=None, cli_args=None): self.dbname = dbconf.split('/')[-1] self.tests = tests self.root = root self.dburi = dbconf - self.log_sql = log_sql self.db_exists = False self.cli_args = cli_args or {} self.init_db(SESSION=SESSION) @@ -86,7 +85,7 @@ self.sa = SESSION else: #init new sessions - engine = create_engine(self.dburi, echo=self.log_sql) + engine = create_engine(self.dburi) init_model(engine) self.sa = Session() diff -r ff287676b206 -r 5b3568c99cc3 kallithea/lib/paster_commands/setup_db.py --- a/kallithea/lib/paster_commands/setup_db.py Wed Apr 26 11:21:56 2017 +0300 +++ b/kallithea/lib/paster_commands/setup_db.py Tue May 09 17:49:31 2017 +0200 @@ -95,7 +95,7 @@ conf = paste.deploy.appconfig('config:' + path_to_ini_file) dbconf = conf['sqlalchemy.url'] - dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], + dbmanage = DbManage(dbconf=dbconf, root=conf['here'], tests=False, cli_args=vars(opts)) dbmanage.create_tables(override=True) opts = dbmanage.config_prompt(None) diff -r ff287676b206 -r 5b3568c99cc3 kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako Wed Apr 26 11:21:56 2017 +0300 +++ b/kallithea/lib/paster_commands/template.ini.mako Tue May 09 17:49:31 2017 +0200 @@ -507,7 +507,6 @@ %endif # see sqlalchemy docs for others -sqlalchemy.echo = false sqlalchemy.pool_recycle = 3600 <%text>################################ diff -r ff287676b206 -r 5b3568c99cc3 kallithea/tests/fixture.py --- a/kallithea/tests/fixture.py Wed Apr 26 11:21:56 2017 +0300 +++ b/kallithea/tests/fixture.py Tue May 09 17:49:31 2017 +0200 @@ -329,7 +329,7 @@ log.debug('Creating testdir %s', repos_test_path) os.makedirs(repos_test_path) - dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=config['here'], + dbmanage = DbManage(dbconf=dbconf, root=config['here'], tests=True) dbmanage.create_tables(override=True) # for tests dynamically set new root paths based on generated content diff -r ff287676b206 -r 5b3568c99cc3 kallithea/tests/test.ini --- a/kallithea/tests/test.ini Wed Apr 26 11:21:56 2017 +0300 +++ b/kallithea/tests/test.ini Tue May 09 17:49:31 2017 +0200 @@ -506,7 +506,6 @@ # see sqlalchemy docs for others -sqlalchemy.echo = false sqlalchemy.pool_recycle = 3600 ################################