2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2015-04-10 17:52:01 +02:00
|
|
|
#include "log.h"
|
2014-07-11 22:12:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
int cw_log_file_flags = LOG_PERROR;
|
|
|
|
char * cw_log_filename = NULL;
|
|
|
|
|
|
|
|
|
2015-04-10 19:51:56 +02:00
|
|
|
void cw_log_vfile(int level,const char * format, va_list args)
|
2014-07-11 22:12:11 +02:00
|
|
|
{
|
|
|
|
vprintf(format,args);
|
2015-04-10 19:51:56 +02:00
|
|
|
printf("\n");
|
2014-07-11 22:12:11 +02:00
|
|
|
}
|
|
|
|
|
2015-04-10 19:51:56 +02:00
|
|
|
void cw_log_file(int level,const char *format, ...)
|
2014-07-11 22:12:11 +02:00
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
va_start(args, format);
|
2015-04-10 19:51:56 +02:00
|
|
|
cw_log_vfile(level,format,args);
|
2014-07-11 22:12:11 +02:00
|
|
|
va_end(args);
|
|
|
|
closelog();
|
|
|
|
}
|
|
|
|
|
|
|
|
|