Simple logger utility to log to console and log file. It depends on colors package. for more information go to (https://github.com/AngelValdes/simple-logger-pkg)
Last updated 4 years ago by angelvaldes .
ISC · Original npm · Tarball · package.json
$ cnpm install av-utility-pkg 
SYNC missed versions from official npm registry.

simple-logger-pkg Simple Logger NPM Package


install the package by, at console command window type:

npm install simple-logger-pkg --save

You also need to create two variables in the application global scope:

global.DEBUG = true; // to enable or disable logging
global.LOGPATH = './logFiles/logfile.log'; // path and log file name 

Note: Make sure the directory path exist in your app for the log, if it does not, create the directory. the file will be created automatically in that directory.

The logfile.log will contain three levels of messages: information, warnings, and errors. you can select level of messages by passing it on the call. ex:

// 0 for information (blue)
// 1 for warning (yellow)
// 2 for error (red)
const logger = require("simple-logger-pkg");
logger.debug("your message", 0); 

Current Tags

  • 1.0.0                                ...           latest (4 years ago)

1 Versions

  • 1.0.0                                ...           4 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |