Merge pull request #7906 from overleaf/em-downgrade-logs

Downgrade all INFO logs to DEBUG

GitOrigin-RevId: 05ed582ef0721fcada059f0ad158565f50feca27
This commit is contained in:
Eric Mc Sween
2022-05-16 08:38:18 -04:00
committed by Copybot
parent efcb06f0df
commit e0d91eaa26
116 changed files with 487 additions and 423 deletions

View File

@@ -87,13 +87,13 @@ module.exports = MemoryMonitor = {
Metrics.gauge('memory.gc-interval', gcInterval)
// Metrics.gauge("memory.cpu-time-bucket", CpuTimeBucket)
logger.log(mem, 'process.memoryUsage()')
logger.debug(mem, 'process.memoryUsage()')
if (global.gc != null && readyToGc()) {
const gcTime = executeAndTime(global.gc).toFixed(2)
const memAfterGc = inMegaBytes(process.memoryUsage())
const deltaMem = updateMemoryStats(memBeforeGc, memAfterGc)
logger.log(
logger.debug(
{
gcTime,
memBeforeGc,

View File

@@ -53,7 +53,7 @@ module.exports = {
const start = new Date()
return _method.call(this, dbCommand, options, function () {
timer.done()
logger.log(
logger.debug(
{
query: dbCommand.query,
query_type: type,
@@ -89,7 +89,7 @@ module.exports = {
const start = new Date()
return _method.call(this, ns, ops, options, function () {
timer.done()
logger.log(
logger.debug(
{
query: ops[0].q,
query_type: type,

View File

@@ -130,10 +130,10 @@ describe('timeAsyncMethod', function () {
describe('when a logger is supplied', function () {
beforeEach(function () {
return (this.logger = { log: sinon.stub() })
return (this.logger = { debug: sinon.stub(), log: sinon.stub() })
})
return it('should also call logger.log', function (done) {
return it('should also call logger.debug', function (done) {
this.timeAsyncMethod(
this.testObject,
'nextNumber',
@@ -145,7 +145,7 @@ describe('timeAsyncMethod', function () {
expect(result).to.equal(3)
expect(this.TimerConstructor.callCount).to.equal(1)
expect(this.Timer.done.callCount).to.equal(1)
expect(this.logger.log.callCount).to.equal(1)
expect(this.logger.debug.callCount).to.equal(1)
return done()
})
})

View File

@@ -36,7 +36,7 @@ module.exports = function (obj, methodName, prefix, logger) {
if (callback == null || typeof callback !== 'function') {
if (logger != null) {
logger.log(
logger.debug(
`[Metrics] expected wrapped method '${methodName}' to be invoked with a callback`
)
}
@@ -74,7 +74,7 @@ module.exports = function (obj, methodName, prefix, logger) {
}
}
} catch (error) {}
logger.log(
logger.debug(
{ key, args: loggableArgs, elapsedTime },
'[Metrics] timed async method call'
)