2 #include "flog_stdio.h"
6 //simple example program
10 FLOG_T
*log_main
,*log_subfunc
,*log_stdout
,*log_stderr
;
11 printf("-[flog test start]-\n");
14 log_main
= create_flog_t(__func__
,FLOG_SHOW_ALL
);
15 log_subfunc
= create_flog_t("subfunc",FLOG_SHOW_ALL
);
16 log_stdout
= create_flog_t("stdout",FLOG_SHOW_ALL
);
17 log_stderr
= create_flog_t("stderr",FLOG_SHOW_ALL
);
19 //set output functions
20 log_stdout
->output_func
=flog_output_stdout
;
21 log_stderr
->output_func
=flog_output_stderr
;
23 //append them to eachother
24 flog_append_sublog(log_subfunc
,log_main
);
25 flog_append_sublog(log_main
,log_stdout
);
26 flog_append_sublog(log_main
,log_stderr
);
28 flog_print(log_subfunc
,FLOG_ERROR
,"print_test","testing...");
29 flog_printf(log_subfunc
,FLOG_ERROR
,"printf_test","testing... %d %d %d",1,2,3);
31 printf("-[flog test suite]-\n");
35 destroy_flog_t(log_subfunc
);
36 destroy_flog_t(log_main
);
37 destroy_flog_t(log_stdout
);
38 destroy_flog_t(log_stderr
);