1.2.5 • Published 4 years ago

logstack v1.2.5

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Logstack NPM Version Total Download CI status

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 = require('logstack');
const path = require('path');

// Please make sure the directory is available and use it only for logstack
const directory = path.join(__dirname, './directory');
const logFileCount = 3;
let log = function (logMessage) {
    // To create log
    logstack.createLog(directory, logFileCount, logMessage);
}
// Just call the function with specified log message
log("Hello from logstack");

To disable logstack

const logstack = require('logstack');
const path = require('path');

// Please make sure the directory is available and use it only for logstack
const directory = path.join(__dirname, './directory');
const logFileCount = 3;
let log = function (logMessage) {
    // Passing false argument will not log the message
    logstack.createLog(directory, logFileCount, logMessage, false);
}
log("Hello from logstack");

To delete log

const logstack = require('logstack');
const path = require('path');

// Please make sure the directory is available and use it only for logstack
const directory = path.join(__dirname, './directory');
const logFileCount = 3;
let deleteLog = function (fileName) {
    logstack.deleteLog(directory, fileName);
}

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

Rohan Shukla GitHub LinkedIn

License

© Licensed under the MIT License.

1.2.5

4 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago