mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
include milliseconds in log timestamps
This commit is contained in:
parent
126172220f
commit
5d6c2514fd
1 changed files with 8 additions and 8 deletions
|
@ -42,16 +42,16 @@
|
|||
static void
|
||||
debugf( const char* format, va_list ap )
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
gettimeofday( &tv, &tz );
|
||||
struct timespec tp = {0};
|
||||
int res = clock_gettime( CLOCK_REALTIME, &tp );
|
||||
XP_ASSERT( 0 == res );
|
||||
struct tm* timp = localtime( &tp.tv_sec );
|
||||
|
||||
struct tm* timp = localtime( &tv.tv_sec );
|
||||
fprintf( stderr, "<%d:%lx> %.2d:%.2d:%.2d:%03ld ", getpid(),
|
||||
pthread_self(), timp->tm_hour, timp->tm_min, timp->tm_sec,
|
||||
tp.tv_nsec / 1000000 );
|
||||
|
||||
fprintf( stderr, "<%d:%lx>%.2d:%.2d:%.2d:", getpid(),
|
||||
pthread_self(), timp->tm_hour, timp->tm_min, timp->tm_sec );
|
||||
|
||||
vfprintf(stderr, format, ap );
|
||||
vfprintf( stderr, format, ap );
|
||||
fprintf( stderr, "%c", '\n' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue