Software /
code /
prosody
Diff
tools/modtrace.lua @ 11197:50f182931bdd
tools.modtrace: Pass config to serialize()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 30 Oct 2020 14:04:40 +0000 |
parent | 11195:c4cb536b67b5 |
child | 12589:39ae08180c81 |
line wrap: on
line diff
--- a/tools/modtrace.lua Fri Oct 30 13:53:39 2020 +0000 +++ b/tools/modtrace.lua Fri Oct 30 14:04:40 2020 +0000 @@ -13,13 +13,20 @@ 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(...)