/tdb-logger

TDB Logger

Primary LanguageTypeScript

Installation:

$ npm install @thedigitalbunch/logger

Importing:

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

Usage:

In a development environment, use environmental variable LOGGER=dev.

const logger = new Logger('TestService');

logger.log('Hello World!');

You can also change the logger options, including the format:

import { developmentConsoleColorFormat, Logger } from '@thedigitalbunch/logger';

Logger.setOptions({ format: developmentConsoleColorFormat() });

You can automatically capture errors with Sentry, by using:

Logger.useSentry({ levels: ['error', 'warning'] });