Index

lognestmonster / e97f197

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
13719 Nov 2019 22:12930a09bLinux timestamps; more detail debug parsingJosh Stockin167N

Blob @ lognestmonster / tests / main.c

text/plain1761 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 event = lnmEvent();
32 lnmEventPushS(event, lnmInfo, "INVOKER/TAG", "Log statement description/message");
33 lnmEventPushS(event, lnmDebug, "INVOKER/TAG", "Log statement description/message");
34 lnmEventPushS(event, lnmVerbose, "INVOKER/TAG", "Log statement description/message");
35 lnmEventPushS(event, lnmVeryVerbose, "INVOKER/TAG", "Log statement description/message");
36 lnmEventPushS(event, lnmWarning, "INVOKER/TAG", "Log statement description/message");
37 lnmEventPushS(event, lnmError, "INVOKER/TAG", "Log statement description/message");
38
39 lnm_debug_parse(event, 0);
40
41 return 0;
42}
43