1.0.0 • Published 4 years ago

@churchill/stream v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

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

OptionDescriptionExample
streamStream to log into{ stream: fs.createWriteStream("temp/stream.log") }
formatCustom formatting function.{ format: (info, out, logger) => ... }
maxLevelMax level to log into this transport.{ maxLevel: "warn" }