node-wartremover - stream transform to turn bunyan json log entries into plaintext

  •        0

Bunyan writes log records as json, and provides a command-line tool to parse the json and generate pretty, colored text for humans.Wartremover allows the human-readable text to be generated inside your server code. It's a stream transform that accepts bunyan json logging and writes human-formatted text.Unlike bunyan, it enforces a "one log entry per line" policy. Every line must be a complete entry, with timestamp and log-level prefix. (An exception is made for stack traces, which are written on multiple lines atomically, but each line will still contain the same prefix.)Example:```javascriptvar bunyan = require("bunyan");var wartremover = require("wartremover");var wart = new wartremover.WartRemover();wart.pipe(process.stdout);var log = bunyan.createLogger({ name: "myserver", streams: [ { level: "debug", stream: wart } ]);log.info("I am writing a debug message!");```Sample log line:```[20141230-06:21:34.773] INF myserver: I am writing a debug message!```

https://github.com/robey/node-wartremover

Tags
Implementation
License
Platform

   




Related Projects