support if: else: endif: conditional tests
[nobug.git] / tests / example.c
blobe37008ee13aaac2aea07880799063d5f40565d09
1 #include "nobug.h"
3 NOBUG_DEFINE_FLAG (test);
5 /* application level logging hook */
6 void callback (const struct nobug_flag* flag, int priority, const char *log, void* data)
8 fprintf (stderr, "callback %s %d %s %p\n", flag->name?flag->name:"", priority, log?log:"NO LOG", data);
12 int
13 main()
15 NOBUG_INIT;
16 NOBUG_INIT_FLAG (test);
18 ECHO ("Testing");
19 INFO (test, "Logging enabled");
20 nobug_logging_callback = callback;
21 nobug_postlogging_callback = callback;
22 WARN (test, "second log line");
23 nobug_callback_data = (void*) 0x1234;
24 ERROR (test, "third log line");
26 return 0;