NOTE: Atlassian has deprecated HipChat in favor of Stride. This library is no longer actively maintained accordingly. Some final formatting changes and a bugfix have been added to the most recent version, but it is no longer possible for me to test them.
A plugin formatter for Bristol that supports sending notifications to Atlassian HipChat.
npm install bristol-hipchat
const Bristol = require('bristol').Bristol();
const BristolHipChat = require('bristol-hipchat');
let logger = new Bristol();
logger.addTarget(new BristolHipChat({
token: 'xxxxxx',
room: 23456,
from: 'myapp',
color: 'red',
notify: true
})
.withFormatter('human')
.withLowestSeverity('error');
token
Type: string
required
The API key used for creating the underlying node-hipchat
client. The API key used must have the notification
permission to send messages. Admin keys should also work fine.
room
Type: number
required
The Room ID to which a message should be sent.
from
Type: string
required
The name of the "person" from whom the message will be sent.
color
Type: string
Default: yellow
Valid values: yellow, green, red, purple, gray, random
The color scheme of the message.
message_format
Type: string
Default: html
Valid values: text, html
The format of the message that will be sent.
notify
Type: boolean
Default:false
A flag indicating whether or not to notify the room. Note that this setting will not override the users' notification preferences for the target room.