Git Product home page Git Product logo

hipchat-logger's Introduction

Node-Hipchat-Logger

Nodejs Hipchat Logger - Get up to 100 messages every 5 minutes directly from your node app to a hipchat room.

A great tool to make development easier when running apps on remote environments.

Note: Is not yet a npm module! To be published soon!

Installation

npm install Node-Hipchat-Logger --save

Set-up

var HipLoggerObj = require('Node-Hipchat-Logger');

var hipLogger = new HipLoggerObj({
    'room-name': '<hip-chat-room-id>', // room to send message to
    'notify': true // optional notification alert to user when new message is sent to room - defaults is set to false
});    

After instantiating the new object, you can call its info, warning and error message functions.

Info message has colour set to gray

Warning message has colour set to yellow

Error message has colour set to red

Call the functions passing in the message you wish to send to the room and function-name from which the message originated.

// Sending a success message
var successMsg = 'Function has ended with success!';
hipLogger.info(successMsg, 'myCoolFunction');

// Sending a warning message
var warningMsg = 'Something has gone wrong! Watch out!';
hipLogger.warning(warningMsg, 'checkingFunction');

// Sending an error message
var errorMsg = 'There was an error with running your function!';
// Or you can send an error object
var errorMsg = new Error('There was an error with running your function!');
hipLogger.error(errorMsg, 'errorFunction');

How the module works

The module will write to a config file that is set per project in the module's directory. On first instantiation of a logger object, Node-Hipchat-Logger will check for the existence of a hip-chat access token in the config.json file. If an access token already exists, this one is used for all your requests to the hip-chat api. If there is no access token, Node-Hipchat-Logger will issue a request to get the token from hip-chat node integartion app to retrieve a valid access token and then store it in the config.json file for the user.

hipchat-logger's People

Contributors

hyprstack avatar

Stargazers

Kostas Kapenekakis avatar Nelson avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.