npm.io
1.6.0 • Published 2 years ago

@rpidanny/quill

Licence
Version
1.6.0
Deps
1
Size
17 kB
Vulns
0
Weekly
0
Stars
2

Core

Core Quill Node.js logger.

Installation

To use Quill, simply install the package from NPM using the following command:

npm i --save @rpidanny/quill

Usage

import Quill from '@rpidanny/quill';
const logger = new Quill({ service: 'my-awesome-service' });

logger.info('hey there');
Hooks

Quill can be effortlessly customized with an array of log transformation functions, also known as hooks. Take a look at the following example, where every log message receives an enchanting prefix.

import Quill from '@rpidanny/quill';

const logger = new Quill({
  service: 'my-awesome-service',
  hooks: [
    (log) => ({
      ...log,
      message: `PREFIX: ${log.message}`,
    }),
  ],
});