A logger for Node

Usage no npm install needed!

<script type="module">
  import qantasAssureLogger from 'https://cdn.skypack.dev/@qantas-assure/logger';


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


[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


yarn add @qantas-assure/logger


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