1 /* SPDX-License-Identifier: GPL-2.0 */
3 /** debug loglevel, gets really noisy */
5 /** still noisy, but won't fill your disk */
7 /** normal, but significant event */
9 /** unexpected event that can be handled */
11 /** unhandled error condition */
13 /** system might be unreliable */
15 /** last message before exit */
18 /** Log messages with lower priority than that will not be compiled in. */
19 #define COMPILE_TIME_LOGLEVEL 0
21 /** Not all compilers support __func__ or an equivalent. */
22 #if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) && !defined(__GNUC__)
23 # if defined(_MSC_VER) && _MSC_VER >= 1300
24 # define __func__ __FUNCTION__
26 # define DSS_NO_FUNC_NAMES
27 # define __func__ "<unknown>"
32 #if DEBUG > COMPILE_TIME_LOGLEVEL
33 #define DSS_DEBUG_LOG(args) \
35 dss_log_set_params(DEBUG, __FILE__, __LINE__, __func__); \
39 #define DSS_DEBUG_LOG(args) do {;} while (0)
42 #if INFO > COMPILE_TIME_LOGLEVEL
43 #define DSS_INFO_LOG(args) \
45 dss_log_set_params(INFO, __FILE__, __LINE__, __func__); \
49 #define DSS_INFO_LOG(args) do {;} while (0)
52 #if NOTICE > COMPILE_TIME_LOGLEVEL
53 #define DSS_NOTICE_LOG(args) \
55 dss_log_set_params(NOTICE, __FILE__, __LINE__, __func__); \
59 #define DSS_NOTICE_LOG(args) do {;} while (0)
62 #if WARNING > COMPILE_TIME_LOGLEVEL
63 #define DSS_WARNING_LOG(args) \
65 dss_log_set_params(WARNING, __FILE__, __LINE__, __func__); \
69 #define DSS_WARNING_LOG(args) do {;} while (0)
72 #if ERROR > COMPILE_TIME_LOGLEVEL
73 #define DSS_ERROR_LOG(args) \
75 dss_log_set_params(ERROR, __FILE__, __LINE__, __func__); \
79 #define DSS_ERROR_LOG(args) do {;} while (0)
82 #if CRIT > COMPILE_TIME_LOGLEVEL
83 #define DSS_CRIT_LOG(args) \
85 dss_log_set_params(CRIT, __FILE__, __LINE__, __func__); \
89 #define DSS_CRIT_LOG(args) do {;} while (0)
92 #if EMERG > COMPILE_TIME_LOGLEVEL
93 #define DSS_EMERG_LOG(args) \
95 dss_log_set_params(EMERG, __FILE__, __LINE__, __func__); \
99 #define DSS_EMERG_LOG(args)