diff --git a/server/Logger.js b/server/Logger.js index 6b589400..3e38f0fd 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) {