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

vipulrahane pushed a commit to branch vipul/juul-master-steam-10-18-2023
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 68203659f5ffca45c0f539071bed0fb75bbb5928
Author: Ben McCrea <[email protected]>
AuthorDate: Wed Aug 30 12:19:29 2023 -0700

    sys/log: Optionally allow "log" command to display log index
---
 sys/log/full/src/log_shell.c | 5 ++++-
 sys/log/full/syscfg.yml      | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/log/full/src/log_shell.c b/sys/log/full/src/log_shell.c
index cf3017a70..5c2a1c00b 100644
--- a/sys/log/full/src/log_shell.c
+++ b/sys/log/full/src/log_shell.c
@@ -69,7 +69,10 @@ shell_log_dump_entry(struct log *log, struct log_offset 
*log_offset,
         console_printf("[ih=0x%x%x%x%x]", ueh->ue_imghash[0], 
ueh->ue_imghash[1],
                        ueh->ue_imghash[2], ueh->ue_imghash[3]);
     }
-    console_printf(" [%llu]  [ix=%lu]", ueh->ue_ts, ueh->ue_index);
+    console_printf(" [%llu] ", ueh->ue_ts);
+#if MYNEWT_VAL(LOG_SHELL_SHOW_INDEX)
+    console_printf(" [ix=%lu] ", ueh->ue_index);
+#endif
 
     switch (ueh->ue_etype) {
     case LOG_ETYPE_STRING:
diff --git a/sys/log/full/syscfg.yml b/sys/log/full/syscfg.yml
index 4d36b8bc6..a717233a0 100644
--- a/sys/log/full/syscfg.yml
+++ b/sys/log/full/syscfg.yml
@@ -69,6 +69,10 @@ syscfg.defs:
         restrictions:
             - SHELL_TASK
 
+    LOG_SHELL_SHOW_INDEX:
+        description: '"log" command shows log index when dumping entries'
+        value: 0
+
     LOG_MGMT:
         description: 'Expose "log" command in mgmt.'
         value: 0

Reply via email to