Logstack
Logstack is simple logger alternative to console.log() which is written in specified file instead of terminal window.
Installation
This is a Node.js module available through the
npm registry.
Installation is done using the
npm install
command:
$ npm install logstack
Example & Usage
To Log the message
const logstack = ;const path = ; // Please make sure the directory is available and use it only for logstackconst directory = path;const logFileCount = 3;let { // To create log logstack;}// Just call the function with specified log message;
To disable logstack
const logstack = ;const path = ; // Please make sure the directory is available and use it only for logstackconst directory = path;const logFileCount = 3;let { // Passing false argument will not log the message logstack;};
To delete log
const logstack = ;const path = ; // Please make sure the directory is available and use it only for logstackconst directory = path;const logFileCount = 3;let { logstack;}
Features
- Prints log messages with time in specific date file
- Provides option to create daily log file
- Useful in applications where you may want to log error, info while in development and production for different parts of the code
- Option to enable and disable logging anytime
- Option to delete log
Author
License
© Licensed under the MIT License.