chore: removed unused file
mellbacon committed
Oct 8, 2023 at 20:39 UTC
30cab1a2281f1991e4336186680ad8a3df42462f
1 file changed
-34
src/config/logger.ts
deleted
-34
@@ -1,34 +0,0 @@
1
-import { error, warn, info } from "tauri-plugin-log-api";
2
-function getScriptName() {
3
- let error = new Error()
4
- let lastStackFrameRegex = new RegExp(/.+\/(.*?):\d+(:\d+)*$/)
5
- let currentStackFrameRegex = new RegExp(/getScriptName \(.+\/(.*):\d+:\d+\)/);
6
-
7
- let lastStack = lastStackFrameRegex.exec(error.stack.trim());
8
- let currentStack = currentStackFrameRegex.exec(error.stack.trim());
9
-
10
- const result = {"location": "???", stack: error.stack};
11
- if (lastStack && lastStack[1] != "") {
12
- result.location = lastStack[1];
13
- }
14
- else if (currentStack) {
15
- result.location = currentStack[1];
16
- }
17
- return result;
18
-}
19
-
20
-export function logInfo(message: string, lineNumber: number) {
21
- const e = getScriptName();
22
- info(message, {file: e.location, line: lineNumber})
23
-}
24
-export function logWarn(message: string, lineNumber: number) {
25
- const e = getScriptName();
26
- warn(message, {file: e.location, line: lineNumber})
27
-}
28
-export function logError(message: string, lineNumber: number, withTrace = false) {
29
- const e = getScriptName();
30
- error(message, {file: e.location, line: lineNumber});
31
- if (withTrace) {
32
- error(e.stack);
33
- }
34
-}