aboutsummaryrefslogtreecommitdiffstats
path: root/util/sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-12 18:57:40 +0200
committerKim Alvefur <zash@zash.se>2017-04-12 18:57:40 +0200
commit2b914fee7d809f0666ca96db8ee49dd4f64db66c (patch)
tree48d570b1bdd8e433a50066d6c17c090156fcb807 /util/sql.lua
parent3604a84b9eca4e5790310552a6c78692a892ec1f (diff)
downloadprosody-2b914fee7d809f0666ca96db8ee49dd4f64db66c.tar.gz
prosody-2b914fee7d809f0666ca96db8ee49dd4f64db66c.zip
util.sql: Strip indentation from queries for debug logging
Diffstat (limited to 'util/sql.lua')
-rw-r--r--util/sql.lua1
1 files changed, 1 insertions, 0 deletions
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