Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
archived/test/t_log.c
Henrik Hautakoski f46ae1970b Change indentation to follow the updated standard.
Alot of mixed indentation. use 4 chars wide soft tabs.
2011-03-19 12:28:48 +02:00

28 lines
605 B
C

#include <errno.h>
#include <stddef.h>
#include "../src/log.h"
int main() {
init_log(LOG_INFO | LOG_WARN, NULL);
logmsg(LOG_INFO, "this is stderr");
logmsg(LOG_CRIT, "Should not show");
logerrno(LOG_CRIT, NULL, ENOENT);
init_log(LOG_INFO | LOG_WARN | LOG_CRIT, "./logs/");
logmsg(LOG_INFO, "some info");
logmsg(LOG_WARN, "invalid type '%i'", 3);
logerrno(LOG_CRIT, "malloc", ENOMEM);
logerrno(LOG_CRIT, NULL, ENOENT);
logmsg(LOG_DEBUG, "Should not show");
logmsg(LOG_INFO | LOG_CRIT, "Should not work, can only log to one priority");
return 0;
}