aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-10-30 14:04:40 +0000
committerMatthew Wild <mwild1@gmail.com>2020-10-30 14:04:40 +0000
commit1ab96f2289a63f6d1fa55b5d131ebf3296206bc2 (patch)
tree53365f3cb4bbf39cfb9e5c236e877a0890023e28 /tools
parentf80e643a0e903c51bec88a6462e60aa96da11506 (diff)
downloadprosody-1ab96f2289a63f6d1fa55b5d131ebf3296206bc2.tar.gz
prosody-1ab96f2289a63f6d1fa55b5d131ebf3296206bc2.zip
tools.modtrace: Pass config to serialize()
Diffstat (limited to 'tools')
-rw-r--r--tools/modtrace.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/modtrace.lua b/tools/modtrace.lua
index 6360fb61..45fa9f6a 100644
--- a/tools/modtrace.lua
+++ b/tools/modtrace.lua
@@ -13,13 +13,20 @@ local serialize = require "util.serialization".serialize;
local unpack = table.unpack or unpack; --luacheck: ignore 113
local set = require "util.set";
+local serialize_cfg = {
+ preset = "oneline";
+ freeze = true;
+ fatal = false;
+ fallback = function (v) return "<"..tostring(v)..">" end;
+};
+
local function stringify_value(v)
if type(v) == "string" and #v > 20 then
return ("<string(%d)>"):format(#v);
elseif type(v) == "function" then
return tostring(v);
end
- return serialize(v, "debug");
+ return serialize(v, serialize_cfg);
end
local function stringify_params(...)