You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/03/16 07:34:28 UTC

[GitHub] andrzej-kaczmarek closed pull request #920: sys/log: Print timestamp as proper uint64

andrzej-kaczmarek closed pull request #920: sys/log: Print timestamp as proper uint64
URL: https://github.com/apache/mynewt-core/pull/920
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/sys/log/full/src/log_console.c b/sys/log/full/src/log_console.c
index 409f4cdae..2fd1d972d 100644
--- a/sys/log/full/src/log_console.c
+++ b/sys/log/full/src/log_console.c
@@ -37,9 +37,8 @@ log_console_append(struct log *log, void *buf, int len)
 
     if (!console_is_midline) {
         hdr = (struct log_entry_hdr *) buf;
-        console_printf("[ts=%lussb, mod=%u level=%u] ",
-                (unsigned long) hdr->ue_ts, hdr->ue_module,
-                hdr->ue_level);
+        console_printf("[ts=%llussb, mod=%u level=%u] ",
+                hdr->ue_ts, hdr->ue_module, hdr->ue_level);
     }
 
     console_write((char *) buf + LOG_ENTRY_HDR_SIZE, len - LOG_ENTRY_HDR_SIZE);
diff --git a/sys/log/full/src/log_shell.c b/sys/log/full/src/log_shell.c
index ae1fd3dfc..c8e41c7ae 100644
--- a/sys/log/full/src/log_shell.c
+++ b/sys/log/full/src/log_shell.c
@@ -56,11 +56,7 @@ shell_log_dump_entry(struct log *log, struct log_offset *log_offset,
     }
     data[rc] = 0;
 
-    /* XXX: This is evil.  newlib printf does not like 64-bit
-     * values, and this causes memory to be overwritten.  Cast to a
-     * unsigned 32-bit value for now.
-     */
-    console_printf("[%lu] %s\n", (unsigned long) ueh.ue_ts, data);
+    console_printf("[%llu] %s\n", ueh.ue_ts, data);
 
     return (0);
 err:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services