Software /
code /
prosody
Changeset
11197:50f182931bdd
tools.modtrace: Pass config to serialize()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 30 Oct 2020 14:04:40 +0000 |
parents | 11196:f243836c449a |
children | 11198:c4c06fbb7d87 |
files | tools/modtrace.lua |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
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(...)