mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #7906 from overleaf/em-downgrade-logs
Downgrade all INFO logs to DEBUG GitOrigin-RevId: 05ed582ef0721fcada059f0ad158565f50feca27
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user