This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 158cc5b4a log_console: Append new line if not present
158cc5b4a is described below

commit 158cc5b4a0beef644d9827fcd0991950139c553c
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Sat May 10 20:25:43 2025 +0200

    log_console: Append new line if not present
    
    If non-cbor log does not end with end of line
    append it when log is printed.
    
    This allows to have shorted logs stored in flash.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 sys/log/full/src/log_console.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/log/full/src/log_console.c b/sys/log/full/src/log_console.c
index b1c578e2a..155a7dffe 100644
--- a/sys/log/full/src/log_console.c
+++ b/sys/log/full/src/log_console.c
@@ -216,6 +216,9 @@ log_console_append_body(struct log *log, const struct 
log_entry_hdr *hdr,
 
     if (hdr->ue_etype != LOG_ETYPE_CBOR) {
         console_write(body, body_len);
+        if (((const uint8_t *)body)[body_len - 1] != '\n') {
+            console_out('\n');
+        }
     } else {
         log_console_dump_cbor_entry(body, body_len);
     }

Reply via email to