mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-14 15:59:38 +00:00
Simplify Logger source
This commit is contained in:
parent
e53ac6566b
commit
20c04d3ed3
1 changed files with 2 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue