logs: use %o to format error

otherwise, they are printed as multi-line and this messes up tail+date formatting
This commit is contained in:
Girish Ramakrishnan
2023-04-16 10:49:59 +02:00
parent e6f870b220
commit c4f4f3e914
29 changed files with 70 additions and 73 deletions

View File

@@ -119,7 +119,7 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) {
});
fileStream.on('error', function (error) {
debug('[%s] upload: out stream error.', backupFilePath, error);
debug(`upload: [${backupFilePath}] out stream error. %o`, error);
callback(new BoxError(BoxError.EXTERNAL_ERROR, error.message));
});
@@ -131,7 +131,7 @@ function upload(apiConfig, backupFilePath, sourceStream, callback) {
if (!safe.fs.chownSync(path.dirname(backupFilePath), backupUid, backupUid)) return callback(new BoxError(BoxError.EXTERNAL_ERROR, 'Unable to chown:' + safe.error.message));
}
debug('upload %s: done.', backupFilePath);
debug(`upload ${backupFilePath}: done`);
callback(null);
});
@@ -187,7 +187,7 @@ function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
});
});
entryStream.on('warn', function (error) {
debug('listDir: warning ', error);
debug('listDir: warning. %o', error);
});
entryStream.on('end', function () {
iteratorCallback(entries, callback);