8000 hipchat-appender: configurable response callback · wxqGitHub/log4js-node@a8eecdb · GitHub
[go: up one dir, main page]

Skip to content

Commit a8eecdb

Browse files
committed
hipchat-appender: configurable response callback
1 parent 6131934 commit a8eecdb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/appenders/hipchat.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports.configure = hipchatConfigure;
88

99
/**
1010
@invoke as
11-
11+
1212
log4js.configure({
1313
"appenders": [
1414
{
@@ -41,7 +41,8 @@ function hipchatAppender(config, layout) {
4141

4242
layout = layout || layouts.messagePassThroughLayout;
4343

44-
return function(loggingEvent) {
44+
// @lint W074 This function's cyclomatic complexity is too high. (10)
45+
return function(loggingEvent){
4546

4647
notifier.setRoom(config.hipchat_room);
4748
notifier.setRoom(config.hipchat_room);
@@ -74,8 +75,9 @@ function hipchatAppender(config, layout) {
7475

7576
// dispatch hipchat api request, do not return anything
7677
// [overide hipchatNotifierResponseCallback]
77-
notifier[notifierFn](layoutMessage, hipchatNotifierResponseCallback);
78-
}
78+
notifier[notifierFn](layoutMessage, config.hipchat_response_callback ||
79+
hipchatNotifierResponseCallback);
80+
};
7981
}
8082

8183
function hipchatConfigure(config) {

0 commit comments

Comments
 (0)
0