Logs: only call Date.now() if a timestamp is not already present

Change-type: patch
This commit is contained in:
Pagan Gazzard 2024-07-16 17:59:07 +01:00 committed by Felipe Lalanne
parent 405ddf2c33
commit 0a817af10c

View File

@ -88,13 +88,8 @@ export class BalenaLogBackend extends LogBackend {
return;
}
message = Object.assign(
{
timestamp: Date.now(),
message: '',
},
message,
);
message.timestamp ??= Date.now();
message.message ??= '';
if (!message.isSystem && message.serviceId == null) {
return;