Skip to content

Commit

Permalink
Merge pull request thelounge#547 from thelounge/PR/actual-debug-option
Browse files Browse the repository at this point in the history
Add debug config option for irc-fw debug log
  • Loading branch information
astorije committed Aug 29, 2016
2 parents f8b2427 + d29c700 commit 5886123
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 8 additions & 1 deletion defaults/config.js
Expand Up @@ -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,
};
10 changes: 6 additions & 4 deletions src/plugins/irc-events/connection.js
Expand Up @@ -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;
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 5886123

Please sign in to comment.