How to use the pino.LOG_VERSION 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 flow-typed / flow-typed / definitions / npm / pino_v3.x.x / test_pino_v3.js View on Github external
// @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();