@qantas-assure/logger
v1.0.1
Published
A logger for Node
Downloads
8
Keywords
Readme
Logger by
A lightweight logger for node servers or client side dev.
Why use this package?
It enables meaningful and granular logging for serverside JS
e.g.
[logic:fetchCmsData] cms cache miss: cmsData
[logic:fetchCmsData] successfully saved cms cache cmsData
[logic:fetchCmsData] cms cache hit: cmsData
[server] cache reset
[logic:fetchCmsData] successfully saved cms cache cmsData
It also has sentry.io logging built in.
Getting started
npm install @qantas-assure/logger --save
OR
yarn add @qantas-assure/logger
Usage
import Logger from '@qantas-assure/logger';
const options = {
logLevel: 'info', // one of 'log', 'info', 'warn', 'error'
appEnv: 'development', // process.env.NODE_ENV
sentryEnabled: false, // if you're using sentry, enable logging with raven-js - https://docs.sentry.io/clients/javascript/
};
const log = new Logger('Component Name', options);