1
2
3
4
5 #include "logging.h"
6
7
8 #include <stdio.h>
9
10 int default_log_func(
int degree,
const char *format, va_list args) {
11 vprintf(format, args);
12 return 0;
13 }
14
15 static cfg_logfunc logfunc = default_log_func;
16
17 int ws_cfg_log(
int degree,
const char *format, ...) {
18 va_list args;
19 va_start(args, format);
20 int ret = logfunc(degree, format, args);
21 va_end(args);
22 return ret;
23 }
24
25 void ws_cfg_set_logfunc(cfg_logfunc func) {
26 logfunc = func;
27 }