Align loader to 32-bit boundary
[fw/stlink] / src / uglylogging.h
1 /*
2  * Ugly, low performance, configurable level, logging "framework"
3  */
4
5 #ifndef UGLYLOGGING_H
6 #define UGLYLOGGING_H
7
8 #ifdef  __cplusplus
9 extern "C" {
10 #endif
11
12 enum ugly_loglevel {
13         UDEBUG = 90,
14         UINFO  = 50,
15         UWARN  = 30,
16         UERROR = 20,
17         UFATAL = 10
18 };
19
20 int ugly_init(int maximum_threshold);
21 int ugly_log(int level, const char *tag, const char *format, ...);
22
23 #define DLOG(format, args...)   ugly_log(UDEBUG, __FILE__, format, ## args)
24 #define ILOG(format, args...)   ugly_log(UINFO, __FILE__, format, ## args)
25 #define WLOG(format, args...)   ugly_log(UWARN, __FILE__, format, ## args)
26 #define ELOG(format, args...)   ugly_log(UERROR, __FILE__, format, ## args)
27 #define fatal(format, args...)  ugly_log(UFATAL, __FILE__, format, ## args)
28
29 #ifdef  __cplusplus
30 }
31 #endif
32
33 #endif  /* UGLYLOGGING_H */
34