From d9f35d1b5e582b99a1e286cff80d6d22906fd885 Mon Sep 17 00:00:00 2001 From: Rolf Bensch Date: Sat, 19 Oct 2019 22:00:35 +0200 Subject: [PATCH 1/2] add timestamp to debug outputs --- sanei/sanei_init_debug.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sanei/sanei_init_debug.c b/sanei/sanei_init_debug.c index 946aee964..236545bdb 100644 --- a/sanei/sanei_init_debug.c +++ b/sanei/sanei_init_debug.c @@ -58,6 +58,8 @@ #include #endif #include +#include +#include #ifdef HAVE_OS2_H # define INCL_DOS @@ -148,7 +150,13 @@ sanei_debug_msg } else { - fprintf (stderr, "[%s] ", be); + struct timeval tv; + struct tm *t; + + gettimeofday (&tv, NULL); + t = localtime (&tv.tv_sec); + + fprintf (stderr, "[%02d:%02d:%02d] [%s] ", t->tm_hour, t->tm_min, t->tm_sec, be); vfprintf (stderr, fmt, ap); } From 738444cd1ca29d0bfe4633f17f1183d5c8e3f1ad Mon Sep 17 00:00:00 2001 From: Rolf Bensch Date: Tue, 26 Nov 2019 17:33:07 +0100 Subject: [PATCH 2/2] =?UTF-8?q?add=20=C2=B5sec=20to=20timestamp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sanei/sanei_init_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanei/sanei_init_debug.c b/sanei/sanei_init_debug.c index 236545bdb..3cde74e57 100644 --- a/sanei/sanei_init_debug.c +++ b/sanei/sanei_init_debug.c @@ -156,7 +156,7 @@ sanei_debug_msg gettimeofday (&tv, NULL); t = localtime (&tv.tv_sec); - fprintf (stderr, "[%02d:%02d:%02d] [%s] ", t->tm_hour, t->tm_min, t->tm_sec, be); + fprintf (stderr, "[%02d:%02d:%02d.%06ld] [%s] ", t->tm_hour, t->tm_min, t->tm_sec, tv.tv_usec, be); vfprintf (stderr, fmt, ap); }