mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-11-07 16:44:16 +01:00
Simplify Logger source
This commit is contained in:
parent
e53ac6566b
commit
20c04d3ed3
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user