mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
lint and format
This commit is contained in:
parent
8376cf1ca2
commit
57ef07dc67
2 changed files with 7 additions and 8 deletions
|
@ -22,7 +22,7 @@ const errSerializer = function (err) {
|
||||||
|
|
||||||
const Logger = (module.exports = {
|
const Logger = (module.exports = {
|
||||||
initialize(name) {
|
initialize(name) {
|
||||||
console.log("IN INIT")
|
console.log('IN INIT')
|
||||||
this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase()
|
this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase()
|
||||||
this.isProduction =
|
this.isProduction =
|
||||||
(process.env.NODE_ENV || '').toLowerCase() === 'production'
|
(process.env.NODE_ENV || '').toLowerCase() === 'production'
|
||||||
|
@ -60,18 +60,18 @@ const Logger = (module.exports = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getTracingEndTimeFile() {
|
async getTracingEndTimeFile() {
|
||||||
return fs.promises.readFile('/logging/tracingEndTime')
|
return fs.promises.readFile('/logging/tracingEndTime')
|
||||||
},
|
},
|
||||||
|
|
||||||
async getTracingEndTimeMetadata() {
|
async getTracingEndTimeMetadata() {
|
||||||
const options = {
|
const options = {
|
||||||
headers: {
|
headers: {
|
||||||
'Metadata-Flavor': 'Google'
|
'Metadata-Flavor': 'Google'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime`
|
const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime`
|
||||||
const res = await fetch(uri,options)
|
const res = await fetch(uri, options)
|
||||||
if (!res.ok) throw new Error("Metadata not okay")
|
if (!res.ok) throw new Error('Metadata not okay')
|
||||||
return res.text()
|
return res.text()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ async getTracingEndTimeMetadata() {
|
||||||
},
|
},
|
||||||
|
|
||||||
_setupLogLevelChecker() {
|
_setupLogLevelChecker() {
|
||||||
console.log("In _setupLogLevelChecker")
|
console.log('In _setupLogLevelChecker')
|
||||||
console.log(this.logger)
|
console.log(this.logger)
|
||||||
if (this.isProduction) {
|
if (this.isProduction) {
|
||||||
// clear interval if already set
|
// clear interval if already set
|
||||||
|
@ -266,7 +266,7 @@ async getTracingEndTimeMetadata() {
|
||||||
if (this.logLevelSource === 'file') {
|
if (this.logLevelSource === 'file') {
|
||||||
this.getTracingEndTime = this.getTracingEndTimeFile
|
this.getTracingEndTime = this.getTracingEndTimeFile
|
||||||
} else if (this.logLevelSource === 'gce_metadata') {
|
} else if (this.logLevelSource === 'gce_metadata') {
|
||||||
this.getTracingEndTime = this.getTracingEndTimeMetadata
|
this.getTracingEndTime = this.getTracingEndTimeMetadata
|
||||||
} else if (this.logLevelSource === 'none') {
|
} else if (this.logLevelSource === 'none') {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,7 +4,6 @@ const chai = require('chai')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const sinon = require('sinon')
|
const sinon = require('sinon')
|
||||||
const sinonChai = require('sinon-chai')
|
const sinonChai = require('sinon-chai')
|
||||||
const { promises } = require('dns')
|
|
||||||
|
|
||||||
chai.use(sinonChai)
|
chai.use(sinonChai)
|
||||||
chai.should()
|
chai.should()
|
||||||
|
|
Loading…
Reference in a new issue