#include <stdio.h>
#include "logger.h"
#define LOG(LVL,...) log_log(LVL,__FILE__,__FUNCTION__ ,__LINE__,__VA_ARGS__)
void test_cb(LogStr msg){
printf("-+-+-+");
fputs(msg,stdout);
}
int main(int argc, char *argv[]){
if( log_init("test.log",LOGBOOL_FALSE,test_cb) != LOGRET_OK )
return -1;
LOG(1,"---Testing logging functionality!");
LOG(11,"---Can't see this! (log level is higher than default)");
log_setlevel(11);
LOG(11,"---Now can see this!");
log_setlevel_console(10);
LOG(11,"---Now only shown in file and cb!");
log_end();
}
Running this program will result in this in the console: