Skip to content

Getting started


Install with:

pnpm add leekslazylogger
npm i leekslazylogger
yarn add leekslazylogger

And require it in your code:

const { Logger } = require('leekslazylogger');
const log = new Logger(options);

For options, see customisation. Omit options to use the defaults.

Basic usage

// or


Default levels
  • debug
  • verbose
  • info
  • success
  • warn
  • notice
  • error
  • critical'information', 'more information');
log.error('oops!', new Error('an error'));
log.debug('something happened!', { something: ['hello', 'world'] });
// in your options:
namespaces: ['commands', 'plugins', 'http']

// ...
log.error.commands('an error occurred during command execution')
log.success.plugins('loaded a plugin')'received a request from someone')

Last update: November 16, 2023