8000 hipchat-appender: use previous color defaults · JJediny/log4js-node@21623c7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 21623c7

Browse files
committed
hipchat-appender: use previous color defaults
1 parent a8eecdb commit 21623c7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

examples/hipchat-appender.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/**
32
* !!! The hipchat-appender requires `hipchat-notifier` from npm
43
* - e.g. list as a dependency in your application's package.json
@@ -12,9 +11,12 @@ log4js.configure({
1211
"type" : "hipchat",
1312
"hipchat_token": "< User token with Notification Privileges >",
1413
"hipchat_room": "< Room ID or Name >",
15-
// optionl
14+
// optional
1615
"hipchat_from": "[ additional from label ]",
17-
"hipchat_notify": "[ notify boolean to bug people ]"
16+
"hipchat_notify": "[ notify boolean to bug people ]",
17 8000 +
"hipchat_response_callback": function(err, response, body){
18+
console.log("overridden log4js hipchat-appender response callback");
19+
}
1820
}
1921
]
2022
});

lib/appenders/hipchat.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"use strict";
2+
23
var hipchat = require('hipchat-notifier');
34
var layouts = require('../layouts');
45

@@ -44,6 +45,8 @@ function hipchatAppender(config, layout) {
4445
// @lint W074 This function's cyclomatic complexity is too high. (10)
4546
return function(loggingEvent){
4647

48+
var notifierFn;
49+
4750
notifier.setRoom(config.hipchat_room);
4851
notifier.setRoom(config.hipchat_room);
4952
notifier.setFrom(config.hipchat_from || '');
@@ -53,11 +56,10 @@ function hipchatAppender(config, layout) {
5356
notifier.setHost(config.hipchat_host);
5457
}
5558

56-
var notifierFn = "success";
5759
switch (loggingEvent.level.toString()) {
5860
case "TRACE":
5961
case "DEBUG":
60-
notifierFn = "notice";
62+
notifierFn = "info";
6163
break;
6264
case "WARN":
6365
notifierFn = "warning";
@@ -67,7 +69,7 @@ function hipchatAppender(config, layout) {
6769
notifierFn = "failure";
6870
break;
6971
default:
70-
notifierFn = "info";
72+
notifierFn = "success";
7173
}
7274

7375
// @TODO, re-work in timezoneOffset ?

0 commit comments

Comments
 (0)
0