Index

lognestmonster / 01b67c5

A general-purpose single-header C logging library and parser for event-based logs. (Incomplete)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
13618 Nov 2019 22:1101b67c5Basic events and event pushing; debug parsingJosh Stockin1101N

Blob @ lognestmonster / tests / main.c

text/plain1467 bytesdownload raw
1// lognestmonster Copyright (c) 2019 Joshua 'joshuas3' Stockin
2// main.c
3// C file for testing the lognestmonster library header
4
5// <https://github.com/JoshuaS3/lognestmonster/>.
6
7
8// This file is part of lognestmonster.
9
10// lognestmonster is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14
15// lognestmonster is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19
20// You should have received a copy of the GNU General Public License
21// along with lognestmonster. If not, see <https://www.gnu.org/licenses/>.
22
23#include <stdio.h>
24#include "lognestmonster.h"
25
26int main(void) {
27 printf("lognestmonster C test main()\n");
28 printf("enums:\n");
29 printf("\tInfo: %d\n\tDebug: %d\n\tVerbose: %d\n\tVeryVerbose: %d\n\tWarning: %d\n\tError: %d\n", lnmInfo, lnmDebug, lnmVerbose, lnmVeryVerbose, lnmWarning, lnmError);
30
31 lnmItem statement = lnmStatement(lnmDebug, "tag", "message");
32 lnmItem event = lnmEvent();
33 lnmItem event2 = lnmEvent();
34 lnmEventPush(event, statement);
35
36 lnmEventPush(event2, statement);
37 lnmEventPush(event, event2);
38 lnmEventPush(event2, statement);
39
40 lnm_debug_parse(event, 0);
41
42 return 0;
43}
44