10 void logit(int type, const char * format, ...)
16 gettimeofday(&now, NULL);
18 struct tm * now_tm = localtime(&(now.tv_sec));
20 if (type == LOG_INFO) {
21 vfprintf(stdout, format, va);
22 fprintf(stdout, "\n");
24 if (type == LOG_DEBUG) {
26 fprintf(stderr, "%02d:%02d:%02d.%03d ", now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec, (int)(now.tv_usec / 1000));
27 vfprintf(stderr, format, va);
28 fprintf(stderr, "\n");
31 vfprintf(stderr, format, va);
32 fprintf(stderr, "\n");