aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning/query.js
blob: 8e25293c0b00eec23fab16c37c91b6aa3e12fab4 (plain) (blame)
1
2
3
4
5
6
7
='n8' href='#n8'>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]}`;
};