Add debug config option for irc-fw debug log

This commit is contained in:
Maxime Poulin 2016-08-06 14:39:39 -04:00 committed by Jérémie Astori
parent 76cafeef23
commit 0c3dc31e31
2 changed files with 14 additions and 5 deletions

View File

@ -357,6 +357,13 @@ module.exports = {
// @default "uid" // @default "uid"
// //
primaryKey: "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 identd = require("../../identd");
var Msg = require("../../models/msg"); var Msg = require("../../models/msg");
var Chan = require("../../models/chan"); var Chan = require("../../models/chan");
var Helper = require("../../helper");
module.exports = function(irc, network) { module.exports = function(irc, network) {
var client = this; 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 if (Helper.config.debug) {
// irc.on("debug", function(message) { irc.on("debug", function(message) {
// log.debug("[" + client.name + " (#" + client.id + ") on " + network.name + " (#" + network.id + ")]", message); log.debug("[" + client.name + " (#" + client.id + ") on " + network.name + " (#" + network.id + ")]", message);
// }); });
}
irc.on("socket error", function(err) { irc.on("socket error", function(err) {
network.channels[0].pushMessage(client, new Msg({ network.channels[0].pushMessage(client, new Msg({