# HG changeset patch # User Kim Alvefur # Date 1679786285 -3600 # Node ID 4533c9b906b04054b73d5c5907e53ad4dacb8492 # Parent fc0109c59807c6d6e7f55f5e13493f2c4f9c9119 util.format: Tweak serialization of %q formatted entries Improves serialization of function references especially, the built-in default handling of that in util.serialization is not the most informative. Now, along with the function metatable from util.startup, the actual function can be found by filename and line number. diff -r fc0109c59807 -r 4533c9b906b0 util/format.lua --- a/util/format.lua Sun Mar 26 00:11:42 2023 +0100 +++ b/util/format.lua Sun Mar 26 00:18:05 2023 +0100 @@ -10,7 +10,14 @@ local pack = table.pack; local valid_utf8 = require "prosody.util.encodings".utf8.valid; local type = type; -local dump = require "prosody.util.serialization".new("debug"); +local dump = require"prosody.util.serialization".new({ + preset = "compact"; + fallback = function(v, why) + return "_[[" .. (why or tostring(v)) .. "]] "; + end; + fatal = false; + maxdepth = 5; +}); local num_type = math.type; -- In Lua 5.3+ these formats throw an error if given a float