summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-02-27 16:40:11 +0000
committerErik Johnston <erik@matrix.org>2017-02-27 16:40:11 +0000
commit8a6196c6c85a0d5aa716749b98d55b74c4435d76 (patch)
treee974ec6975011b6beec4f1b636aa7fc826af4c0c /synapse/storage/_base.py
parentLocal changes (diff)
parentMerge pull request #1954 from matrix-org/erikj/cache_device2 (diff)
downloadsynapse-8a6196c6c85a0d5aa716749b98d55b74c4435d76.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-27
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py

index b0dc391190..557701d0c4 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py
@@ -80,7 +80,13 @@ class LoggingTransaction(object): def executemany(self, sql, *args): self._do_execute(self.txn.executemany, sql, *args) + def _make_sql_one_line(self, sql): + "Strip newlines out of SQL so that the loggers in the DB are on one line" + return " ".join(l.strip() for l in sql.splitlines() if l.strip()) + def _do_execute(self, func, sql, *args): + sql = self._make_sql_one_line(sql) + # TODO(paul): Maybe use 'info' and 'debug' for values? sql_logger.debug("[SQL] {%s} %s", self.name, sql)