@qantas-assure/logger

1.0.1 • Public • Published

Logger by Qantas Loyalty

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);

/@qantas-assure/logger/

    Package Sidebar

    Install

    npm i @qantas-assure/logger

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.63 MB

    Total Files

    16

    Last publish

    Collaborators

    • bluebill1049
    • lukeboyle
    • willmcpo
    • yusinto