12 static void __log(const char *fmt, va_list ap)
14 char hms[20] = {'\0'};
22 strftime(hms, sizeof(hms), "%T", localtime(&t));
23 fprintf(logf, "[%s] ", hms);
25 vfprintf(logf, fmt, ap);
29 void pb_log(const char *fmt, ...)
37 void pb_debug(const char *fmt, ...)
47 void __pb_log_init(FILE *fp, bool _debug)
55 void pb_log_set_debug(bool _debug)
60 FILE *pb_log_get_stream(void)
62 static FILE *null_stream;
65 null_stream = fopen("/dev/null", "a");