@brooswajne/terrier
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

terrier

Terrier is a talkative little dog, which takes care of all your logging needs. Zero dependencies. Simple, straightforward interface and API with no extra complication.

Super simple to use:

import { createLogger } from 'terrier';

const logger = createLogger( );
logger.debug('Initializing greeting...');
logger.info('Hello world!');
logger.trace('User greeted.');

const child = logger.child('jim');
child.debug('Doing some work...');
child.error('Child labour is illegal!');

Fully configurable (see the LoggerConfiguration interface for a description of all the options):

import { intlFormat } from 'date-fns';
import { Writable } from 'stream';
import {
  LoggerLevel,
  createLogger,
} from 'terrier';

const logger = createLogger({
  // only log messages with priority 'info' or above
  level: LoggerLevel.Info,
  // custom timestamp formatting
  timestamp: ( ) => intlFormat(new Date( ), { locale: 'ko-KR' }),
  // custom output stream
  stream: (level) => new Writable(/* ... */),
});

Readme

Keywords

none

Package Sidebar

Install

npm i @brooswajne/terrier

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

22.6 kB

Total Files

19

Last publish

Collaborators

  • brooswajne