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_log_fn(const char *func, const char *fmt, ...)
46 void pb_debug(const char *fmt, ...)
56 void _pb_debug_fn(const char *func, const char *fmt, ...)
67 void _pb_debug_fl(const char *func, int line, const char *fmt, ...)
72 pb_log("%s:%d: ", func, line);
78 void __pb_log_init(FILE *fp, bool _debug)
86 void pb_log_set_debug(bool _debug)
91 FILE *pb_log_get_stream(void)
93 static FILE *null_stream;
96 null_stream = fopen("/dev/null", "a");