Rev 3 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
/* $Id: check.c 2 2024-08-25 10:11:51Z nishi $ */
#include "config.h"
#include <stdio.h>
int check_log(void) {
int count = 0;
const char* name = "";
#ifdef USE_SYSLOG
name = "Syslog";
count++;
#endif
#ifdef USE_STDERR
name = "stderr";
count++;
#endif
if(count == 0) {
fprintf(stderr, "Select a logger\n");
return 1;
} else if(count > 1) {
fprintf(stderr, "Too many loggers\n");
return 1;
} else {
printf("Using %s for logging\n", name);
return 0;
}
}
int main() {
int st = 0;
st = check_log();
if(st != 0) goto cleanup;
cleanup:
return st;
}