logtown-winston

Logtown wrapper for winston logger

Usage no npm install needed!

<script type="module">
  import logtownWinston from 'https://cdn.skypack.dev/logtown-winston';
</script>

README

logtown-winston

Logtown wrapper for winston logger

Installation

yarn add logtown-winston winston 

or

npm install logtown-winston winston

Usage

const logtown = require('logtown');
const WinstonWrapper = require('logtown-winston');
const winston = require('winston');

const customTransportsArray = [
    new winston.transports.Console({
      json: false,
      colorize: true,
      prettyPrint: true,
      timestamp: true,
      handleExceptions: true,
      align: false,
      level: 'silly'
    })
];

const customWinstonOptions = {exitOnError: false};

logtown.addWrapper(new WinstonWrapper(customTransportsArray, customWinstonOptions));

For reference of winston options see winston docs

ES5 usage

var WinstonWrapper = require('logtown-winston/es5');

License

Logtown-winston is released under the MIT license.

Donate