simple-winston-logger-abstraction

logger abstraction for winston

Usage no npm install needed!

<script type="module">
  import simpleWinstonLoggerAbstraction from 'https://cdn.skypack.dev/simple-winston-logger-abstraction';
</script>

README

simple-winston-logger-abstraction

DESCRIPTION:

Wraps around winston logger instantion and exposes info, error, debug methods

USAGE:

// typescript
import logger from 'simple-winston-logger-abstraction'
// js
const logger = require('simple-winston-logger-abstraction');

// Info method
logger.info(`calling method with this payload ${JSON.stringify(payload)}`, "request_id")

// Error method
logger.error(`error: ${err.message}`)
logger.debug(`error: ${err.message} ${err.stack}`)

// Debug method
logger.debug(`calling method with this payload ${JSON.stringify(payload)} and this ID ${id}`)

Set an environment variable LOG_LEVEL:"debug||info||error" for required logging level.