0.2.0 • Published 8 months ago

@dopt/logger v0.2.0

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

Dopt Logger

Getting Started

The Dopt Logger offers a convenient framework for support logLevel configuration and templated logging. Allowing you to enable logging in your packages based on log levels and with defined styled template for your node terminal and browser console.

Installation

Via npm:

npm install @dopt/logger

Via Yarn:

yarn add @dopt/logger

Via pnpm:

pnpm add @dopt/logger

Usage

Initialization

You can initialize Dopt in your app by integrating the Logger as follows:

import { Logger } from '@dopt/logger';

const log = new Logger({ logLevel: 'debug', prefix: ` <Any Prefix> ` });
log.info('This is informational log');

Note: For debugging purposes, you can add a logLevel prop to Logger which sets the minimum log level printed to the console. This accepts the following values: 'trace', 'debug' 'info', 'warn', 'error', 'silent' (default) .