kernel: Write parts of truncated messages to the log.
In case any one message (or, more likely, importing the bootloader's syslog buffer) is too large for our buffer, do not discard it, but keep as much as we can, and print <TRUNC> at the beginning of it, to distinguish from <DROP>. (Documentation already notes <TRUNC> as a possible thing to find in the syslog.)
This commit is contained in:
@@ -1269,8 +1269,10 @@ syslog_write(const char* text, int32 length, bool notify)
|
||||
return;
|
||||
|
||||
if (length > sSyslogBuffer->size) {
|
||||
text = "<DROP>";
|
||||
length = 6;
|
||||
syslog_write("<TRUNC>", 7, false);
|
||||
|
||||
text += length - (sSyslogBuffer->size - 7);
|
||||
length = sSyslogBuffer->size - 7;
|
||||
}
|
||||
|
||||
int32 writable = ring_buffer_writable(sSyslogBuffer);
|
||||
|
||||
Reference in New Issue
Block a user