Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import pino from "pino";
import type { Logger } from "pino";
(pino.LOG_VERSION: number);
const p: Logger = pino();
p.info("hello world");
p.error("this is at error level");
p.info("the answer is %d", 42);
p.info({ obj: 42 }, "hello world");
p.info({ obj: 42, b: 2 }, "hello world");
p.info({ obj: { aa: "bbb" } }, "another");
setImmediate(p.info, "after setImmediate");
p.error(new Error("an error"));
// $ExpectError
p("no log level");
const pretty = pino.pretty();