Software /
code /
prosody
Diff
util/sql.lua @ 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 |
parent | 8076:6e0defa19ab9 |
child | 8084:655837e9eeeb |
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