blob: aab110c2b549d51dbb10c2814898a340cc0c0256 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
import pino from "pino";
export const l = (...msgs) => pino().info(msgs.join(" "));
export const warn = (...msgs) => pino().warn(msgs.join(" "));
export const err = (...msgs) => pino().error(msgs.join(" "));
export const line = () => {
const stack = new Error().stack;
const stackLine = stack.split("\n")[1];
const match = stackLine.match(/at\s+(.*):(\d+):(\d+)/);
return `${match[1]}:${match[2]}`;
};
|