mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-23 04:48:07 +00:00
Logs: only truncate the message if it's possible it will need it
Change-type: patch
This commit is contained in:
parent
34cf8b6708
commit
c5d0eafea9
@ -93,12 +93,12 @@ export class BalenaLogBackend extends LogBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message.timestamp ??= Date.now();
|
message.timestamp ??= Date.now();
|
||||||
message.message ??= '';
|
message.message = message.message
|
||||||
|
? _.truncate(message.message, {
|
||||||
message.message = _.truncate(message.message, {
|
length: MAX_LOG_LENGTH,
|
||||||
length: MAX_LOG_LENGTH,
|
omission: '[...]',
|
||||||
omission: '[...]',
|
})
|
||||||
});
|
: '';
|
||||||
|
|
||||||
this.write(message);
|
this.write(message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user