From 1fed75fb4599d70390cdcc679fc3310942cd2ab0 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 30 Oct 2020 14:04:40 +0000 Subject: tools.modtrace: Pass config to serialize() --- tools/modtrace.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tools') 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 (""):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(...) -- cgit v1.2.3