mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Merge pull request #2326 from lkiesow/hide-dev-logs
Allow enabling dev logs
This commit is contained in:
commit
2e06ae01a1
@ -5,6 +5,7 @@ class Logger {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.isDev = process.env.NODE_ENV !== 'production'
|
this.isDev = process.env.NODE_ENV !== 'production'
|
||||||
this.logLevel = !this.isDev ? LogLevel.INFO : LogLevel.TRACE
|
this.logLevel = !this.isDev ? LogLevel.INFO : LogLevel.TRACE
|
||||||
|
this.hideDevLogs = process.env.HIDE_DEV_LOGS === undefined ? !this.isDev : process.env.HIDE_DEV_LOGS === '1'
|
||||||
this.socketListeners = []
|
this.socketListeners = []
|
||||||
|
|
||||||
this.logManager = null
|
this.logManager = null
|
||||||
@ -92,7 +93,7 @@ class Logger {
|
|||||||
* @param {...any} args
|
* @param {...any} args
|
||||||
*/
|
*/
|
||||||
dev(...args) {
|
dev(...args) {
|
||||||
if (!this.isDev || process.env.HIDE_DEV_LOGS === '1') return
|
if (this.hideDevLogs) return
|
||||||
console.log(`[${this.timestamp}] DEV:`, ...args)
|
console.log(`[${this.timestamp}] DEV:`, ...args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user