mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 03:53:40 -05:00
Log args and their indexes, if they look like object ids
This commit is contained in:
parent
e7f71a25d8
commit
be2c6a96af
1 changed files with 6 additions and 1 deletions
|
@ -21,5 +21,10 @@ module.exports = (obj, methodName, prefix, logger) ->
|
||||||
realMethod.call this, firstArgs..., (callbackArgs...) ->
|
realMethod.call this, firstArgs..., (callbackArgs...) ->
|
||||||
elapsedTime = timer.done()
|
elapsedTime = timer.done()
|
||||||
if logger?
|
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
|
callback.apply this, callbackArgs
|
||||||
|
|
Loading…
Reference in a new issue