logz

1.0.2 • Public • Published

logz

Logz is a simple, dependency free, Node.js module for logging.

Use

npm install logz

Logz must be initialized but if no params are sent on init the values below are used.

var logz = require('logz');

logz.init({
  dir: './logs', // logs directory
  file: '/log.txt', // log file name
  level: 'debug', // err, info, debug
  console: true // log to console
});

Levels

There are three levels: err, info, and debug.

err

Logged for all levels.

logz.err('something failed')
// -> timestamp ERROR something failed

info

Logged for err, and info levels.

logz.info('something happened')
// -> timestamp INFO something happened

debug

Logged only for the debug level.

logz.debug('some response object')
// -> timestamp DEBUG some response object

Readme

Keywords

none

Package Sidebar

Install

npm i logz

Weekly Downloads

28

Version

1.0.2

License

none

Last publish

Collaborators

  • samuelgilman