1 /*******************************************************************
2 uLan Utilities Library - C library of basic reusable constructions
4 ul_log.h - standard logging facility
6 (C) Copyright 2005 by Pavel Pisa - Originator
8 The uLan utilities library can be used, copied and modified under
10 - GPL - GNU General Public License
11 - LGPL - GNU Lesser General Public License
12 - MPL - Mozilla Public License
13 - and other licenses added by project originators
14 Code can be modified and re-distributed under any combination
15 of the above listed licenses. If contributor does not agree with
16 some of the licenses, he/she can delete appropriate line.
17 Warning, if you delete all lines, you are not allowed to
18 distribute source code and/or binaries utilizing code.
20 See files COPYING and README for details.
22 *******************************************************************/
24 #include <ul_logbase.h>
26 #define UL_LOG_CUST(log_domain) \
28 ul_log_domain_t log_domain; \
31 void ul_loglev(int level, const char *format, ...) UL_ATTR_PRINTF (2, 3);\
33 void ul_vloglev(int level, const char *format, va_list ap) \
35 ul_vlog(&log_domain, level, format, ap); \
39 void ul_loglev(int level, const char *format, ...) \
42 va_start(ap, format); \
43 ul_vloglev(level, format, ap); \
48 void ul_logfatal(const char *format, ...) UL_ATTR_PRINTF (1, 2);\
50 void ul_logfatal(const char *format, ...) \
53 va_start(ap, format); \
54 ul_vloglev(UL_LOGL_FATAL, format, ap); \
59 void ul_logerr(const char *format, ...) UL_ATTR_PRINTF (1, 2);\
61 void ul_logerr(const char *format, ...) \
64 va_start(ap, format); \
65 ul_vloglev(UL_LOGL_ERR, format, ap); \
70 void ul_logmsg(const char *format, ...) UL_ATTR_PRINTF (1, 2);\
72 void ul_logmsg(const char *format, ...) \
75 va_start(ap, format); \
76 ul_vloglev(UL_LOGL_MSG, format, ap); \
81 void ul_loginf(const char *format, ...) UL_ATTR_PRINTF (1, 2);\
83 void ul_loginf(const char *format, ...) \
86 va_start(ap, format); \
87 ul_vloglev(UL_LOGL_INF, format, ap); \
92 void ul_logdeb(const char *format, ...) UL_ATTR_PRINTF (1, 2);\
94 void ul_logdeb(const char *format, ...) \
97 va_start(ap, format); \
98 ul_vloglev(UL_LOGL_DEB, format, ap); \
103 void ul_logtrash(const char *format, ...) UL_ATTR_PRINTF (1, 2);\
105 void ul_logtrash(const char *format, ...) \
108 va_start(ap, format); \
109 ul_vloglev(UL_LOGL_TRASH, format, ap); \