1.0.6 • Published 7 years ago

lggrr v1.0.6

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

lggrr

lggrr is a really lightweight, customizable logger for node.js servers.

Usage

const lggrr = require('lggrr').lggrr;
const log = new lggrr();

log.log("Hello log.");

Specifying options

You can specify the options for the logger by giving the constructor an options object.

const lggrr = require('lggrr').lggrr;
const log = new lggrr({
  path: "./logs",
  timeStamp: true,
  console: true
});

log.log("Hello log.");

You can also set the different option flags after using the constructor.

const lggrr = require('lggrr').lggrr;
const log = new lggrr();

log.path = "./log";
log.timeStamp = true;
log.console = true;

log.log("Hello log.");

Logging

The logged text gets saved at the specified path with a filename of the date.

You can use all the normal functions you would use from the console object:

  • log
  • info
  • warn
  • error

Options

OptionEffectDefault
pathSpecifies the path that the log files will be saved in./
timeStampEnables and disables timeStamp in log file on and offtrue
consoleEnables and disables if logging should also show up on the consoletrue