@churchill/stream

Churchill stream transport

Usage no npm install needed!

<script type="module">
  import churchillStream from 'https://cdn.skypack.dev/@churchill/stream';
</script>

README

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" }