Software /
code /
prosody
Comparison
util/datamanager.lua @ 706:ce772e283992
datamanager: Change log message from type "warn" to "debug" when loading a file fails
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 13 Jan 2009 19:41:52 +0500 |
parent | 643:8ff454831f7d |
child | 732:0343739f3d71 |
comparison
equal
deleted
inserted
replaced
705:11afa1d88c55 | 706:ce772e283992 |
---|---|
86 end | 86 end |
87 | 87 |
88 function load(username, host, datastore) | 88 function load(username, host, datastore) |
89 local data, ret = loadfile(getpath(username, host, datastore)); | 89 local data, ret = loadfile(getpath(username, host, datastore)); |
90 if not data then | 90 if not data then |
91 log("warn", "Failed to load "..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil")); | 91 log("debug", "Failed to load "..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil")); |
92 return nil; | 92 return nil; |
93 end | 93 end |
94 setfenv(data, {}); | 94 setfenv(data, {}); |
95 local success, ret = pcall(data); | 95 local success, ret = pcall(data); |
96 if not success then | 96 if not success then |
161 end | 161 end |
162 | 162 |
163 function list_load(username, host, datastore) | 163 function list_load(username, host, datastore) |
164 local data, ret = loadfile(getpath(username, host, datastore, "list")); | 164 local data, ret = loadfile(getpath(username, host, datastore, "list")); |
165 if not data then | 165 if not data then |
166 log("warn", "Failed to load "..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil")); | 166 log("debug", "Failed to load "..datastore.." storage ('"..ret.."') for user: "..(username or "nil").."@"..(host or "nil")); |
167 return nil; | 167 return nil; |
168 end | 168 end |
169 local items = {}; | 169 local items = {}; |
170 setfenv(data, {item = function(i) t_insert(items, i); end}); | 170 setfenv(data, {item = function(i) t_insert(items, i); end}); |
171 local success, ret = pcall(data); | 171 local success, ret = pcall(data); |