fix(objects): use proper seq log templating (#2384)

* fix(objects): use proper seq log templating

* fix(objects): log message temp variable
This commit is contained in:
Gergő Jedlicska
2024-06-18 10:17:50 +02:00
committed by GitHub
parent ef4bb520cf
commit 3be2d72e7d
3 changed files with 10 additions and 6 deletions
@@ -46,9 +46,11 @@ module.exports = (app) => {
req.log.error(err, `App error streaming objects`)
} else {
req.log.info(
`Streamed ${childrenList.length} objects (size: ${
gzipStream.bytesWritten / 1000000
} MB)`
{
childCount: childrenList.length,
mbWritten: gzipStream.bytesWritten / 1000000
},
'Streamed {childCount} objects (size: {mbWritten} MB)'
)
}
}
@@ -26,7 +26,7 @@ module.exports = (app) => {
const objectList = JSON.parse(req.body.objects)
req.log.info(`Diffing ${objectList.length} objects.`)
req.log.info({ objectCount: objectList.length }, 'Diffing {objectCount} objects.')
const chunkSize = 1000
const objectListChunks = chunk(objectList, chunkSize)
+4 -2
View File
@@ -151,12 +151,13 @@ module.exports = (app) => {
req.log.info(
{
objectCount: objs.length,
durationSeconds: (Date.now() - t0) / 1000,
crtMemUsageMB: process.memoryUsage().heapUsed / 1024 / 1024,
uploadedSizeMB: gunzippedBuffer.length / 1000000,
requestDropped
},
`Uploaded batch of ${objs.length} objects`
'Uploaded batch of {objectCount} objects'
)
})
} else if (
@@ -240,12 +241,13 @@ module.exports = (app) => {
await promise
req.log.info(
{
objectCount: objs.length,
uploadedSizeMB: estimateStringMegabyteSize(buffer),
durationSeconds: (Date.now() - t0) / 1000,
crtMemUsageMB: process.memoryUsage().heapUsed / 1024 / 1024,
requestDropped
},
`Uploaded batch of ${objs.length} objects.`
'Uploaded batch of {objectCount} objects.'
)
})
} else {