# HG changeset patch # User Kim Alvefur # Date 1492016260 -7200 # Node ID 29b3957db21230f7844ac458e173afbd61189b03 # Parent 6e0defa19ab989d80f819789afe40145a9652e78 util.sql: Strip indentation from queries for debug logging diff -r 6e0defa19ab9 -r 29b3957db212 util/sql.lua --- 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