2.2.1 • Published 7 years ago

brody_logger v2.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Utility-Tool

Logging utility tool #installation

$ npm install brody_logger

Usage

Version Bumper

With the utility tool required to your node file call the .bump method with the arguments of Semantic Version Number and how you would like the number incremented ('Major', 'Minor', or 'Patch'). This is case insensitive. Your server will require access to the .env file. I recommend adding the 'dotenv' node module

$ npm i --save dotenv
require('dotenv').config();
const logger = require('brody_logger');

// Note: You should supply the old version number dynamically
const newVersionNumber = logger.bump('1.11.111', 'patch'));

Logging

  • To enable debugging create an environmental variable in the .env file and set it to true.

    DEBUG=true

    in the .env file - Logs will be presented in the terminal window.

  • To disable debugging set env DEBUG=false in the .env file

The logging functions are handled by the debugUtility.js the four methods for debugging are

  • err
  • warn
  • debug
  • log

to include the debugUtility in your files place

const logger = require('brody_logger');

To use the looger throughout your code simple treat the logger as you would a

console.log()

Example:

//some code
logger.log('Message I want to send to the terminal or log file without any tag');
//some code
logger.debug('Message I want to send to terminal or log file with a debug flag');
//some code
logger.err('Message I want to send to terminal or log file with an err flag');
//some code
logger.warn('Message I want to send to terminal or log file with an warn flag')

logger.sys('Message I want to send to terminal or log file with an sys flag')
 // * The sys flag will prepend a timestamp to the message.

Colors for the individual flags can be modified in the debugUtility.js

2.2.1

7 years ago

2.2.0

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago