minimenu now has a (lame) 'reveal this normally hidden' category option in the select...
[pandora-libraries.git] / test / loggertest.c
1
2 #include "pnd_logger.h"
3
4 // arbitrary warning level
5 #define PLOG_LOW    0
6 #define PLOG_MEDIUM 1
7 #define PLOG_HIGH   2
8
9 int main ( void ) {
10
11   pnd_log ( PLOG_LOW, "low message, should be ignored" );
12
13   /* normal operation -------------- */
14   pnd_log_to_stdout();
15   pnd_log ( PLOG_LOW, "low message, should go stdout once" );
16   /* ------------------------------- */
17
18   /* extra testing vvvvvvvvvvvvvvvvv
19    */
20
21   pnd_log_to_stdout();
22   pnd_log ( PLOG_LOW, "low message, should go stdout twice" );
23
24   pnd_log_to_nil();
25   pnd_log_to_stdout();
26
27   pnd_log_set_pretext ( "loggertest" );
28   pnd_log ( PLOG_LOW, "low message, emit once, with pretext" );
29
30   pnd_log_set_filter ( PLOG_MEDIUM );
31   pnd_log ( PLOG_LOW, "low message, emit once, filter is medium+" );
32   pnd_log ( PLOG_MEDIUM, "medium message, emit once, filter is medium+" );
33   pnd_log ( PLOG_HIGH, "high message, emit once, filter is medium+" );
34
35   pnd_log_set_filter ( PLOG_LOW );
36   pnd_log ( PLOG_LOW, "low message, emit once, filter is low+ again" );
37
38   return ( 0 );
39 }