andrzej-kaczmarek commented on code in PR #3400:
URL: https://github.com/apache/mynewt-core/pull/3400#discussion_r2079569218


##########
sys/log/full/src/log_cbmem.c:
##########
@@ -40,21 +51,61 @@ log_cbmem_append_body(struct log *log, const struct 
log_entry_hdr *hdr,
                 .flat_buf = body,
                 .flat_len = body_len,
             },
+#if MYNEWT_VAL(LOG_FLAGS_TRAILER_SUPPORT)
+            {
+                .flat_buf = trailer,
+                .flat_len = 0
+            },
+            {
+                .flat_buf = NULL,
+                .flat_len = 0,
+            },
         },
-        .count = 3,
+        .count = 5,
+#else
+            {
+                .flat_buf = NULL,
+                .flat_len = 0,
+            },
+        },
+        .count = 4,
+#endif
     };
 
+#if MYNEWT_VAL(LOG_FLAGS_TRAILER_SUPPORT)
+    if (hdr->ue_flags & LOG_FLAGS_IMG_HASH) {
+        sg->entries[1].flat_len = LOG_IMG_HASHLEN;
+    }
+
+    if (hdr->ue_flags & LOG_FLAGS_TRAILER_SUPPORT) {
+        rc = log_trailer_append(log, trailer, &trailer_len, NULL, NULL);

Review Comment:
   The same append callback expects the application to either write the data to 
the log or return it in provided buffer depending on the log type - how is that 
"for the sake of simplicity and consistency"?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to