Skip to content

thalesfsp/bunyan-hipchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bunyan-hipchat

Bunyan Illustration by Brendan Corris

Stream to write bunyan logs to HipChat.

Usage

var bunyan = require('bunyan');
var BunyanHipchat = require('bunyan-hipchat');

var token = '1234512345123451234512345123451234512345'
var roomID = '12345';

// Add HipChat plugin/stream to Bunyan
var logger = bunyan.createLogger({
  name: 'API',
  streams: [
    {
      level: 'trace',
      stream: process.stdout
    }, {
      level: 'trace',
      stream: new BunyanHipchat({
        token: token,
        roomId: roomId
      }),
      type: 'raw'
    }
  ]
});

// Log different levels
logger.trace('trace');
logger.debug('debug');
logger.info('info');
logger.warn('warn');
logger.error('error');
logger.fatal('fatal');

Example

Note: Don't forget to fill with a valid token and roomId

TOKEN="" ROOMID="" npm run example

Contributors

This project was created by Thales Pinheiro (@thalesfsp)

Roadmap

  • Next version: 2.0
  • Features:
    • Add tests
    • Move to ES6
    • Use standard
    • Allow selection between api V1/V2