@nody-org/logger
v1.4.0
Published
All-in-one, production-ready logger
Downloads
34
Readme
Description
All-in-one, production-ready logger
How to install
// to install with yarn
yarn add @nody-org/logger
// to install with npm
npm install @nody-org/logger
How to use
import { Logger, ConsoleIntegration } from '@nody-org/logger'
const logger = new Logger()
// add your chosen integrations
logger.addIntegration(new ConsoleIntegration({
level: 'debug',
}));
// this context is always added to the logs meta
logger.setContext({
appName: '{{appName}}',
sessionId: '{{sessionId}}'
});
logger.debug('==> your message', {
anyKey: 'any-value',
});
Feel free to collaborate!