Permalink
Browse files

Log whenever a plugin returns something other than CONT

  • Loading branch information...
1 parent fe54fc3 commit 59ba4b36ad63159b3232a6fb6404d44ea78c4582 @smfreegard smfreegard committed Jan 14, 2012
Showing with 4 additions and 4 deletions.
  1. +1 −1 configfile.js
  2. +3 −3 plugins.js
View
2 configfile.js
@@ -33,7 +33,7 @@ cfreader.read_config = function(name, type, cb) {
// file has changed
if (curr.mtime.getTime() !== prev.mtime.getTime()) {
cfreader.load_config(name, type);
- if(typeof cb === 'function') cb();
+ if (typeof cb === 'function') cb();
}
});
}
View
6 plugins.js
@@ -208,9 +208,9 @@ plugins.run_next_hook = function(hook, object, params) {
// Log what is being run
if (item && hook !== 'log') {
var log = 'logdebug';
- var is_deny = utils.in_array(retval, [constants.deny, constants.denysoft, constants.denydisconnect, constants.denysoftdisconnect]);
- if (is_deny) log = 'loginfo';
- if (logger.would_log(logger.LOGDEBUG) || is_deny) {
+ var is_not_cont = (retval === constants.cont) ? false : true;
+ if (is_not_cont) log = 'loginfo';
+ if (logger.would_log(logger.LOGDEBUG) || is_not_cont) {
object[log]([
'hook=' + hook,
'plugin=' + item[0].name,

0 comments on commit 59ba4b3

Please sign in to comment.