Statistics
| Branch: | Revision:

streamers / dbg.c @ d8e83543

History | View | Annotate | Download (506 Bytes)

1
/*
2
 *  Copyright (c) 2010 Luca Abeni
3
 *  Copyright (c) 2010 Csaba Kiraly
4
 *
5
 *  This is free software; see gpl-3.0.txt
6
 */
7
#include <sys/time.h>
8
#include <stdio.h>
9
#include <stdarg.h>
10

    
11
#include "dbg.h"
12

    
13
static struct timeval tnow;
14

    
15
int ftprintf(FILE *stream, const char *format, ...)
16
{
17
  va_list ap;
18
  int ret;
19
  
20
  gettimeofday(&tnow, NULL);
21
  fprintf(stream, "%ld.%03ld ", tnow.tv_sec, tnow.tv_usec/1000);
22

    
23
  va_start (ap, format);
24
  ret = vfprintf(stderr, format, ap);
25
  va_end (ap);
26
  
27
  return ret;
28
}