Changeset

8077:29b3957db212

util.sql: Strip indentation from queries for debug logging
author Kim Alvefur <zash@zash.se>
date Wed, 12 Apr 2017 18:57:40 +0200
parents 8076:6e0defa19ab9
children 8078:60207251863c 8079:b058fc4a4243
files util/sql.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Wed Apr 12 17:26:44 2017 +0200
+++ b/util/sql.lua	Wed Apr 12 18:57:40 2017 +0200
@@ -160,6 +160,7 @@
 
 local function debugquery(where, sql, ...)
 	local i = 0; local a = {...}
+	sql = sql:gsub("\n?\t+", " ");
 	log("debug", "[%s] %s", where, sql:gsub("%?", function () i = i + 1; local v = a[i]; if type(v) == "string" then v = ("%q"):format(v); end return tostring(v); end));
 end