@churchill/stream

1.0.0 • Public • Published

Stream transport

Send your logged data to any arbitrary stream.

npm install @churchill/stream

Usage

const churchill = require("@churchill/core");
const Stream = require("@churchill/stream");

const stream = fs.createWriteStream("temp/stream.log");
stream.on("error", (err) => {
  // ... you should handle errors
});

const createNamespace = churchill({
  transports: [Stream.create({ stream })]
});

const logger = createNamespace("worker:1");
logger.info("...");

Options

Option Description Example
stream Stream to log into { stream: fs.createWriteStream("temp/stream.log") }
format Custom formatting function. { format: (info, out, logger) => ... }
maxLevel Max level to log into this transport. { maxLevel: "warn" }

Package Sidebar

Install

npm i @churchill/stream

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

5.23 kB

Total Files

5

Last publish

Collaborators

  • alesmenzel