kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'debug_add_timestamp' into 'master'
add timestamp to debug outputs See merge request sane-project/backends!228merge-requests/255/merge
commit
4156fae159
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue