andrzej-kaczmarek commented on code in PR #3400:
URL: https://github.com/apache/mynewt-core/pull/3400#discussion_r2164050298
##########
sys/log/full/include/log/log.h:
##########
@@ -218,6 +272,21 @@ struct log {
#endif
#if MYNEWT_VAL(LOG_STATS)
STATS_SECT_DECL(logs) l_stats;
+#endif
+ /* Custom log init callback to be called by the last hdr
+ * read function to read custom data from log entries
+ * at init
+ */
+ log_walk_func_t l_init_cb;
+
+#if MYNEWT_VAL(LOG_FLAGS_TRAILER)
+ /* Log trailer support */
+ /* Void argument for callbacks registeration */
+ void *l_tr_arg;
Review Comment:
this argument shall be passed to all callbacks, otherwise it doesn't make
any sense
##########
sys/log/full/src/log_fcb.c:
##########
@@ -324,20 +331,15 @@ log_fcb_start_append(struct log *log, int len, struct
fcb_entry *loc)
return (rc);
}
-/**
- * Calculates the number of message body bytes that should be included after
- * the entry header in the first write. Inclusion of body bytes is necessary
- * to satisfy the flash hardware's write alignment restrictions.
- */
static int
-log_fcb_hdr_body_bytes(uint8_t align, uint8_t hdr_len)
+log_fcb_hdr_trailer_bytes(uint16_t align, uint16_t len)
Review Comment:
should not be renamed since it apparently is still used when trailer support
is disabled
##########
sys/log/full/include/log/log.h:
##########
@@ -218,6 +272,21 @@ struct log {
#endif
#if MYNEWT_VAL(LOG_STATS)
STATS_SECT_DECL(logs) l_stats;
+#endif
+ /* Custom log init callback to be called by the last hdr
+ * read function to read custom data from log entries
+ * at init
+ */
+ log_walk_func_t l_init_cb;
Review Comment:
make this also a syscfg and disabled by default
--
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]