Skip to content

Commit

Permalink
Simplify Logger source
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Aug 14, 2024
1 parent e53ac65 commit 20c04d3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 20c04d3

Please sign in to comment.