summaryrefslogtreecommitdiffstats
path: root/tests/syslog_caller.c
blob: 91a1f08b7e845fa289362c22543d65bf39e8304b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>

int main(int argc, char *argv[])
{
	int i;
	int sev = 0;
	if(argc != 2) {
		fprintf(stderr, "usage: syslog_caller num-messages\n");
		exit(1);
	}

	int msgs = atoi(argv[1]);

	for(i = 0 ; i < msgs ; ++i) {
		syslog(sev % 8, "test message nbr %d, severity=%d", i, sev % 8);
		sev++;
	}
}