@thedigitalbunch/logger
v1.1.5
Published
TDB Logger
Downloads
47
Readme
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'] });