Skip to content

element-gaming/logger-utils

Repository files navigation

Logger utils

Maintainability Known Vulnerabilities npm

Logger utils for the popular Winston Node.js logging framework.

Features

  • Winston console logger
  • Winston file logger with daily rotation
  • Morgan setup

Installation

$ yarn add @element-gaming/logger-utils
$ npm install @element-gaming/logger-utils

Usage

Setup winston logger

const { logger } = require('@element-gaming/logger-utils');

logger.log('info', 'This is information', {data: ''})
logger.info('This is information!')
logger.warn('This is a warning!')
logger.error('This is a problem!')
logger.verbose('This is verbose!')
logger.debug('This is a debug!')

Setup morgan logger

const { morgan } = require('@element-gaming/logger-utils');

app.use(morgan.successHandler);
app.use(morgan.errorHandler);

Contributing

  1. Learn more in the Contributing guide Please take a look at the contributing guide.
  2. Fork this project
  3. Install dependencies (yarn or npm install)

License

MIT © 2020 Element Gaming ASD