winston-transport

Base stream implementations for winston@3 and up.

MIT 24 个版本
安装
npm install winston-transport
yarn add winston-transport
pnpm add winston-transport
bun add winston-transport
README

winston-transport

The base TransportStream implementation for winston >= 3. Use these to write ecosystem Transports for winston.

Usage

const Transport = require('winston-transport');
const util = require('util');

//
// Inherit from `winston-transport` so you can take advantage
// of the base functionality and `.exceptions.handle()`.
//
module.exports = class CustomTransport extends Transport {
  constructor(opts) {
    super(opts);

    //
    // Consume any custom options here. e.g.:
    // - Connection information for databases
    // - Authentication information for APIs (e.g. loggly, papertrail,
    //   logentries, etc.).
    //
  }

  log(info, callback) {
    setImmediate(() => {
      this.emit('logged', info);
    });

    // Perform the writing to the remote service

    callback();
  }
};

Tests

Tests are written with mocha, nyc, assume, and abstract-winston-transport. They can be run with npm:

npm test
Author: Charlie Robbins
LICENSE: MIT
版本列表
4.9.0 2024-11-10
4.8.1 2024-11-10
4.8.0 2024-09-27
4.7.1 2024-07-10
4.7.0 2024-02-04
4.6.0 2023-10-13
4.5.0 2022-02-05
4.4.2 2022-01-10
4.4.1 2021-12-14
4.4.0 2020-06-21
4.3.0 2018-12-23
4.2.0 2018-06-12
4.1.0 2018-05-31
4.0.0 2018-05-24
3.2.1 2018-04-25
3.2.0 2018-04-22
3.1.0 2018-04-06
3.0.1 2017-10-02
3.0.0 2017-09-29
2.1.1 2017-09-29
2.1.0 2017-09-27
2.0.0 2017-04-11
1.0.2 2015-11-30
1.0.1 2015-11-27