diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-10-30 14:04:40 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-10-30 14:04:40 +0000 |
commit | 1fed75fb4599d70390cdcc679fc3310942cd2ab0 (patch) | |
tree | 53365f3cb4bbf39cfb9e5c236e877a0890023e28 /tools | |
parent | f29013fb0c1b161d7f7ddcb335ef3191ce32bf5d (diff) | |
download | prosody-1fed75fb4599d70390cdcc679fc3310942cd2ab0.tar.gz prosody-1fed75fb4599d70390cdcc679fc3310942cd2ab0.zip |
tools.modtrace: Pass config to serialize()
Diffstat (limited to 'tools')
-rw-r--r-- | tools/modtrace.lua | 9 |
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(...) |