Merge pull request #547 from thelounge/PR/actual-debug-option

Add debug config option for irc-fw debug log
This commit is contained in:
Jérémie Astori 2016-08-29 02:08:30 -04:00 committed by GitHub
commit 2af0435ee6
2 changed files with 14 additions and 5 deletions

View File

@ -357,6 +357,13 @@ module.exports = {
// @default "uid"
//
primaryKey: "uid"
}
},
// Enables extra debugging output. Turn this on if you experience
// IRC connection issues and want to file a bug report.
//
// @type boolean
// @default false
//
debug: false,
};

View File

@ -2,6 +2,7 @@ var _ = require("lodash");
var identd = require("../../identd");
var Msg = require("../../models/msg");
var Chan = require("../../models/chan");
var Helper = require("../../helper");
module.exports = function(irc, network) {
var client = this;
@ -74,10 +75,11 @@ module.exports = function(irc, network) {
});
}
// TODO Add a debug mode. See https://github.com/thelounge/lounge/issues/459
// irc.on("debug", function(message) {
// log.debug("[" + client.name + " (#" + client.id + ") on " + network.name + " (#" + network.id + ")]", message);
// });
if (Helper.config.debug) {
irc.on("debug", function(message) {
log.debug("[" + client.name + " (#" + client.id + ") on " + network.name + " (#" + network.id + ")]", message);
});
}
irc.on("socket error", function(err) {
network.channels[0].pushMessage(client, new Msg({