From 7cde12528343fa4e8cef1276fb699e1c57d6ad60 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 16 Sep 2021 15:04:54 -0400 Subject: [PATCH] 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 at the beginning of it, to distinguish from . (Documentation already notes as a possible thing to find in the syslog.) --- src/system/kernel/debug/debug.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index 780180f70d..21f1516981 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -1269,8 +1269,10 @@ syslog_write(const char* text, int32 length, bool notify) return; if (length > sSyslogBuffer->size) { - text = ""; - length = 6; + syslog_write("", 7, false); + + text += length - (sSyslogBuffer->size - 7); + length = sSyslogBuffer->size - 7; } int32 writable = ring_buffer_writable(sSyslogBuffer);