aboutsummaryrefslogtreecommitdiffstats
path: root/lib/logging.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-09 23:10:35 -0800
committerAdam Soltys <[email protected]>2024-01-09 23:10:39 -0800
commit7a84d2555ffabbe29b23cf6e5035b6a4be8b9eb6 (patch)
tree9fe2b7d523bbfe34176f115cb6823403fef1f802 /lib/logging.js
parente06878e18fc33e392fd16b76d1ab9f25f8bc7fbe (diff)
downloadcoinos-server-7a84d2555ffabbe29b23cf6e5035b6a4be8b9eb6.tar.gz
coinos-server-7a84d2555ffabbe29b23cf6e5035b6a4be8b9eb6.zip
remove users from archive once migrated
Diffstat (limited to 'lib/logging.js')
-rw-r--r--lib/logging.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/logging.js b/lib/logging.js
index 5ad3a0b0..4913839a 100644
--- a/lib/logging.js
+++ b/lib/logging.js
@@ -1,5 +1,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 let l = (...msgs) => pino().info(msgs.join(" "));
+export let warn = (...msgs) => pino().warn(msgs.join(" "));
+export let err = (...msgs) => pino().error(msgs.join(" "));
+
+export let line = () => {
+ let stack = new Error().stack;
+ let stackLine = stack.split("\n")[1];
+ let match = stackLine.match(/at\s+(.*):(\d+):(\d+)/);
+ return `${match[1]}:${match[2]}`;
+};