0.1.0 • Published 3 years ago

@gxyz/data.logger v0.1.0

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 years ago

@gxyz/data.logger

@gxyz/data.logger is a Winston Data logger storing data in Console.

Installation

Install the module locally via your favorite npm client, like npm:

npm install @gxyz/data.logger

or yarn:

yarn add @gxyz/data.logger

Usage

Take a look at Winston docs.

const logger = require('@gxyz/data.logger');

Examples

logger.error({
  message: new Error('Oops!... I Did It Again'),
  name: 'Britney Spears',
});
logger.log({
  level: 'info',
  message: 'Hello, World!',
  name: 'GalaXYZ',
});

Transports

You may also dynamically change the log level of a transport.

Using custom transports subpath ./transports:

const transports = require('@gxyz/data.logger/transports');

Using this path is not recommended:

const transports = require('@gxyz/data.logger/lib/transports');

transports.consoleStore

consoleStore is the only store available.

const {consoleStore,} = transports;

consoleStore.level = 'verbose';

Credits

Aziz Da
Aziz Da

License

Unlicense