vrahane commented on code in PR #3400:
URL: https://github.com/apache/mynewt-core/pull/3400#discussion_r2076102170


##########
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:
   That's a good catch. Thank you. I will check the existence of `log->l_th` to 
set the flag.



##########
sys/log/full/src/log.c:
##########
@@ -571,6 +691,10 @@ log_append_prepare(struct log *log, uint8_t module, 
uint8_t level,
     }
 #endif
 
+#if MYNEWT_VAL(LOG_FLAGS_TRAILER_SUPPORT)
+    ue->ue_flags |= LOG_FLAGS_TRAILER_SUPPORT;

Review Comment:
   That's a good catch. Thank you. I will check the existence of `log->l_th` to 
set the flag.



-- 
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