How to use the pino.stdTimeFunctions function in pino

To help you get started, we’ve selected a few pino examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github btd / huzzah / benchmark / json.js View on Github external
var EE = require("events").EventEmitter;

var LoggerFactory = require("../factory");
var StreamHandler = require("../handlers").StreamHandler;
var jsonFormat = require("../json-format");

var bunyan = require("bunyan");
var pino = require("pino");
var pinoLogger = pino({ timestamp: pino.stdTimeFunctions.slowTime });
var pinoLoggerFast = pino({});

var stdout = new EE();
stdout.write = function(out, encoding, cb) {
  if (typeof encoding === "function") {
    cb = encoding;
    encoding = null;
  }
  cb && cb();
  return true;
};

var f1 = new LoggerFactory({ handlerConstructor: StreamHandler });

var l1 = f1.get("a");
f1