From 20c04d3ed32ad46c456c03114092f53feff08859 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 14 Aug 2024 16:36:10 -0500 Subject: [PATCH] Simplify Logger source --- server/Logger.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/Logger.js b/server/Logger.js index 6b58940054..3e38f0fd5c 100644 --- a/server/Logger.js +++ b/server/Logger.js @@ -32,12 +32,8 @@ class Logger { * @returns {string} */ get source() { - try { - throw new Error() - } catch (error) { - const regex = global.isWin ? /^.*\\([^\\:]*:[0-9]*):[0-9]*\)*/ : /^.*\/([^/:]*:[0-9]*):[0-9]*\)*/ - return error.stack.split('\n')[3].replace(regex, '$1') - } + const regex = global.isWin ? /^.*\\([^\\:]*:[0-9]*):[0-9]*\)*/ : /^.*\/([^/:]*:[0-9]*):[0-9]*\)*/ + return Error().stack.split('\n')[3].replace(regex, '$1') } getLogLevelString(level) {