some more docs about resourcetracking
[nobug.git] / tests / example.c
blob3400eed53a42bcafc2a41197baa23030441a640f
1 #include "nobug.h"
3 NOBUG_DEFINE_FLAG (test);
5 /* application level logging hook */
6 void callback (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, data);
12 int
13 main()
15 NOBUG_INIT;
16 NOBUG_INIT_FLAG (test);
18 ECHO ("Testing");
19 INFO (test, "Logging enabled");
20 nobug_callback = callback;
21 WARN (test, "second log line");
22 nobug_callback_data = (void*) 0x1234;
23 ERROR (test, "third log line");
25 return 0;