diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-02-02 17:14:32 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-02-02 17:14:32 +0100 |
commit | 5dadc28ea784db1ba1f56c2ea8618d2db67af1c8 (patch) | |
tree | 808b2499b54563b3290f34d70d159b1024310873 /sanei/sanei_init_debug.c | |
parent | 5bb4cf12855ec0151de15d6c5a2354ff08766957 (diff) | |
parent | 3dade5db2a37543f19f0967901d8d80a52a1e459 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'sanei/sanei_init_debug.c')
-rw-r--r-- | sanei/sanei_init_debug.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sanei/sanei_init_debug.c b/sanei/sanei_init_debug.c index 946aee9..3cde74e 100644 --- a/sanei/sanei_init_debug.c +++ b/sanei/sanei_init_debug.c @@ -58,6 +58,8 @@ #include <sys/socket.h> #endif #include <sys/stat.h> +#include <time.h> +#include <sys/time.h> #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.%06ld] [%s] ", t->tm_hour, t->tm_min, t->tm_sec, tv.tv_usec, be); vfprintf (stderr, fmt, ap); } |