add library versioning
[nobug.git] / tests / example.c
blobdf9140420026ad8d4126881aa38beae74e6dcbc3
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 NOTICE (test, "Multi\nline\nlogging");
28 return 0;