Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #pragma once
00038
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00062 DRIZZLE_LOCAL
00063 void drizzle_set_error(drizzle_st *drizzle, const char *function,
00064 const char *format, ...);
00065
00075 DRIZZLE_LOCAL
00076 void drizzle_log(drizzle_st *drizzle, drizzle_verbose_t verbose,
00077 const char *format, va_list args);
00078
00082 static inline void drizzle_log_fatal(drizzle_st *drizzle, const char *format,
00083 ...)
00084 {
00085 va_list args;
00086
00087 if (drizzle->verbose >= DRIZZLE_VERBOSE_FATAL)
00088 {
00089 va_start(args, format);
00090 drizzle_log(drizzle, DRIZZLE_VERBOSE_FATAL, format, args);
00091 va_end(args);
00092 }
00093 }
00094
00098 static inline void drizzle_log_error(drizzle_st *drizzle, const char *format,
00099 ...)
00100 {
00101 va_list args;
00102
00103 if (drizzle->verbose >= DRIZZLE_VERBOSE_ERROR)
00104 {
00105 va_start(args, format);
00106 drizzle_log(drizzle, DRIZZLE_VERBOSE_ERROR, format, args);
00107 va_end(args);
00108 }
00109 }
00110
00114 static inline void drizzle_log_info(drizzle_st *drizzle, const char *format,
00115 ...)
00116 {
00117 va_list args;
00118
00119 if (drizzle->verbose >= DRIZZLE_VERBOSE_INFO)
00120 {
00121 va_start(args, format);
00122 drizzle_log(drizzle, DRIZZLE_VERBOSE_INFO, format, args);
00123 va_end(args);
00124 }
00125 }
00126
00130 static inline void drizzle_log_debug(drizzle_st *drizzle, const char *format,
00131 ...)
00132 {
00133 va_list args;
00134
00135 if (drizzle->verbose >= DRIZZLE_VERBOSE_DEBUG)
00136 {
00137 va_start(args, format);
00138 drizzle_log(drizzle, DRIZZLE_VERBOSE_DEBUG, format, args);
00139 va_end(args);
00140 }
00141 }
00142
00146 static inline void drizzle_log_crazy(drizzle_st *drizzle, const char *format,
00147 ...)
00148 {
00149 va_list args;
00150
00151 if (drizzle->verbose >= DRIZZLE_VERBOSE_CRAZY)
00152 {
00153 va_start(args, format);
00154 drizzle_log(drizzle, DRIZZLE_VERBOSE_CRAZY, format, args);
00155 va_end(args);
00156 }
00157 }
00158
00161 #ifdef __cplusplus
00162 }
00163 #endif