Software /
code /
clix
Comparison
clix.lua @ 70:5e93cfc73444
clix: Fix logging for new Verse
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 12 Feb 2012 20:45:06 +0000 |
parent | 52:95ea1dca92ed |
child | 82:30f85754b1e0 |
comparison
equal
deleted
inserted
replaced
69:4b65a9a0229b | 70:5e93cfc73444 |
---|---|
56 local account = accounts[opts.account or "default"]; | 56 local account = accounts[opts.account or "default"]; |
57 if not (account and account.jid) then | 57 if not (account and account.jid) then |
58 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); | 58 io.stderr:write("The specified account (", opts.account or "default", ") wasn't found in the config file\n"); |
59 return nil; | 59 return nil; |
60 end | 60 end |
61 verse.set_logger(opts.verbose and verse.logger() or verse.filter_log({"error"}, verse.logger())); | 61 verse.set_log_handler(io.stderr, not opts.verbose and {"error"}); |
62 local conn = verse.new(verse.logger()); | 62 local conn = verse.new(); |
63 for _, plugin in ipairs(plugins or {}) do | 63 for _, plugin in ipairs(plugins or {}) do |
64 conn:add_plugin(plugin); | 64 conn:add_plugin(plugin); |
65 end | 65 end |
66 conn.log.debug = opts.verbose; | |
67 conn:hook("authentication-failure", function (err) | 66 conn:hook("authentication-failure", function (err) |
68 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); | 67 conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or "")); |
69 conn:close(); | 68 conn:close(); |
70 end); | 69 end); |
71 conn:hook("ready", function () | 70 conn:hook("ready", function () |