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
;const logger = ; // Note: You should supply the old version number dynamicallyconst newVersionNumber = logger);
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 = ;
To use the looger throughout your code simple treat the logger as you would a
console
Example:
//some codelogger;//some codelogger;//some codelogger;//some codelogger logger // * The sys flag will prepend a timestamp to the message.
Colors for the individual flags can be modified in the debugUtility.js