summaryrefslogtreecommitdiff
path: root/sanei/sanei_init_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'sanei/sanei_init_debug.c')
-rw-r--r--sanei/sanei_init_debug.c10
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);
}