1.0.5 • Published 5 months ago

adhisimon-logger v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

adhisimon-logger

Version npm Npm package total downloads node.js version Unit test status Module type: CJS js-semistandard-style jsDocs.io License

My simple logger (based on winston).

It just init winston to display fancy colored logs on console with metadata that I think was important. Also put logs on rotating files if it's not running on unit test.

Installation

npm i adisimon-logger

Usage

const { create: createLogger } = require('adhisimon-logger');

const logger = createLogger({
  // all options are optional, here are default values
  level: 'verbose', // or process.env.LOG_LEVEL
  disableFileTransport: false, // it would always ignored if running on unit test
  dir: 'logs', // or process.env.LOG_DIR
  fileLevel: 'verbose', // will use "level" options if not specified
  baseFilename: 'app', // or process.env.LOG_BASE_FILENAME
  keepFiles: 31, // or process.env.LOG_KEEP_FILES
});

Unit test detection

It detect unit test by detecting global "describe" function does exists.

Changelog

See CHANGELOG.md file.

Planned transports

I have plan to implement these transports too:

  • http transport
  • mysql transport
  • amqp transport
  • redis transport

License

This package based on winston which has MIT License, so this package too.

See it on LICENSE file.

1.0.5

5 months ago

1.0.4

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.2

5 months ago

0.1.0

5 months ago

0.0.1

5 months ago