projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
3a79d72
)
util.serialization: Log a warning when trying to serialize something we can't
author
Matthew Wild
<mwild1@gmail.com>
Mon, 4 May 2009 18:35:29 +0000
(19:35 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Mon, 4 May 2009 18:35:29 +0000
(19:35 +0100)
util/serialization.lua
patch
|
blob
|
history
diff --git
a/util/serialization.lua
b/util/serialization.lua
index bff0f306fef5ae0f78e1ba75f094ae7df02cedb4..41d963e905d47a956c70d5f3ed9ee164edcba692 100644
(file)
--- a/
util/serialization.lua
+++ b/
util/serialization.lua
@@
-14,6
+14,8
@@
local t_concat = table.concat;
local error = error;
local pairs = pairs;
+local debug_traceback = debug.traceback;
+local log = require "util.logger".init("serialization");
module "serialization"
local indent = function(i)
@@
-50,7
+52,7
@@
local function _simplesave(o, ind, t, func)
elseif type(o) == "boolean" then
func(t, (o and "true" or "false"));
else
-
error("cannot serialize a " .. type(o
))
+
log("warn", "cannot serialize a %s: %s", type(o), debug_traceback(
))
end
end