mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
catch
This commit is contained in:
parent
74e2a5eaa1
commit
6917847b10
1 changed files with 8 additions and 1 deletions
|
@ -22,6 +22,7 @@ const errSerializer = function (err) {
|
|||
|
||||
const Logger = (module.exports = {
|
||||
initialize(name) {
|
||||
console.log("IN INIT")
|
||||
this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase()
|
||||
this.isProduction =
|
||||
(process.env.NODE_ENV || '').toLowerCase() === 'production'
|
||||
|
@ -39,6 +40,7 @@ const Logger = (module.exports = {
|
|||
})
|
||||
this._setupRingBuffer()
|
||||
this._setupStackdriver()
|
||||
console.log(this.logger)
|
||||
this._setupLogLevelChecker()
|
||||
return this
|
||||
},
|
||||
|
@ -52,6 +54,7 @@ const Logger = (module.exports = {
|
|||
this.logger.level(this.defaultLevel)
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
this.logger.level(this.defaultLevel)
|
||||
}
|
||||
},
|
||||
|
@ -253,6 +256,8 @@ async getTracingEndTimeMetadata() {
|
|||
},
|
||||
|
||||
_setupLogLevelChecker() {
|
||||
console.log("In _setupLogLevelChecker")
|
||||
console.log(this.logger)
|
||||
if (this.isProduction) {
|
||||
// clear interval if already set
|
||||
if (this.checkInterval) {
|
||||
|
@ -269,7 +274,9 @@ async getTracingEndTimeMetadata() {
|
|||
return
|
||||
}
|
||||
// check for log level override on startup
|
||||
this.checkLogLevel()
|
||||
this.checkLogLevel().catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
// re-check log level every minute
|
||||
this.checkInterval = setInterval(this.checkLogLevel.bind(this), 1000 * 60)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue