mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
Log args and their indexes, if they look like object ids
This commit is contained in:
@@ -21,5 +21,10 @@ module.exports = (obj, methodName, prefix, logger) ->
|
||||
realMethod.call this, firstArgs..., (callbackArgs...) ->
|
||||
elapsedTime = timer.done()
|
||||
if logger?
|
||||
logger.log {key, elapsedTime}, "[Metrics] timed async method call"
|
||||
loggableArgs = {}
|
||||
try
|
||||
for arg, idx in firstArgs
|
||||
if arg.toString().match(/^[0-9a-f]{24}$/)
|
||||
loggableArgs["#{idx}"] = arg
|
||||
logger.log {key, args: loggableArgs, elapsedTime}, "[Metrics] timed async method call"
|
||||
callback.apply this, callbackArgs
|
||||
|
||||
Reference in New Issue
Block a user