@smarterservices/smarter-logging

0.0.3 • Public • Published

SmarterLogging

Unified logging package for back end (front end coming soon)

Installing

Make sure you have an NPM token from smarterservices and then just do an npm install

npm install @smarterservices/smarter-logging

Usage

At the start of your application

const logger = require('@smarterservices/smarter-logging');

// 1st param is Program Name
// 2nd param is an object containing labels for the application
logger.init('TestLogging', { A_LABEL: 'Don\'t Label Me' });

To send a message

// 1st Param label
// 2nd Param Message
// 3rd Param Object you want to log(optional)
logger.info(logger.labels.A_LABEL, 'hello this is a message', { hi: "d it" });

Logging different severities

logger.warn(logger.labels.A_LABEL, 'hello this is a message', { hi: "d it" });
logger.error(logger.labels.A_LABEL, 'hello this is a message', { hi: "d it" });
logger.info(logger.labels.A_LABEL, 'hello this is a message', { hi: "d it" });
logger.debug(logger.labels.A_LABEL, 'hello this is a message', { hi: "d it" });

Readme

Keywords

none

Package Sidebar

Install

npm i @smarterservices/smarter-logging

Weekly Downloads

6

Version

0.0.3

License

ISC

Unpacked Size

22.2 kB

Total Files

8

Last publish

Collaborators

  • cameron_wise
  • astarr19
  • matthew.underhill
  • smarterservicesdev
  • jasonfill