From b3cd19063f63fa426f35523bfb77be45d1e0dd4e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 12 Apr 2017 18:57:40 +0200 Subject: util.sql: Strip indentation from queries for debug logging --- util/sql.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'util') diff --git a/util/sql.lua b/util/sql.lua index c7a79278..f7c68ed3 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -160,6 +160,7 @@ local result_mt = { __index = { 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 -- cgit v1.2.3