23 #ifndef INCLUDE_WEBCOM_C_WEBCOM_LOG_H_ 24 #define INCLUDE_WEBCOM_C_WEBCOM_LOG_H_ 26 #include "webcom-config.h" 70 typedef void(*
wc_log_f)(
const char *f,
const char *l,
const char *file,
const char *func,
int line,
const char *message);
173 __attribute__ ((format (printf, 6, 7)));
204 #define W_LOG(_facility, _level, _fmt, ...) \ 205 wc_log((_facility), (_level), \ 206 __FILE__, __func__, __LINE__, \ 207 _fmt"\n", ## __VA_ARGS__) 209 #define W_EXDBG(_facility, _fmt, ...) W_LOG((_facility), WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__) 210 #define W_DBG( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_DEBUG, _fmt, ## __VA_ARGS__) 211 #define W_INFO( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_INFO, _fmt, ## __VA_ARGS__) 212 #define W_NOT( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_NOTICE, _fmt, ## __VA_ARGS__) 213 #define W_WARN( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_INFO, _fmt, ## __VA_ARGS__) 214 #define W_ERR( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_ERR, _fmt, ## __VA_ARGS__) 215 #define W_CRIT( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_CRIT, _fmt, ## __VA_ARGS__) 216 #define W_ALRT( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_ALERT, _fmt, ## __VA_ARGS__) 217 #define W_EMRG( _facility, _fmt, ...) W_LOG((_facility), WC_LOG_EMERG, _fmt, ## __VA_ARGS__) 220 #ifndef LOCAL_LOG_FACILITY 221 # define LOCAL_LOG_FACILITY WC_LOG_GENERAL 266 #define WL_LOG(_level, _fmt, ...) W_LOG(LOCAL_LOG_FACILITY, (_level), _fmt, ## __VA_ARGS__) 268 #define WL_EXDBG(_fmt, ...) WL_LOG(WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__) 269 #define WL_DBG( _fmt, ...) WL_LOG(WC_LOG_DEBUG, _fmt, ## __VA_ARGS__) 270 #define WL_INFO( _fmt, ...) WL_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__) 271 #define WL_NOT( _fmt, ...) WL_LOG(WC_LOG_NOTICE, _fmt, ## __VA_ARGS__) 272 #define WL_WARN( _fmt, ...) WL_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__) 273 #define WL_ERR( _fmt, ...) WL_LOG(WC_LOG_ERR, _fmt, ## __VA_ARGS__) 274 #define WL_CRIT( _fmt, ...) WL_LOG(WC_LOG_CRIT, _fmt, ## __VA_ARGS__) 275 #define WL_ALRT( _fmt, ...) WL_LOG(WC_LOG_ALERT, _fmt, ## __VA_ARGS__) 276 #define WL_EMRG( _fmt, ...) WL_LOG(WC_LOG_EMERG, _fmt, ## __VA_ARGS__) 302 #define APP_LOG(_level, _fmt, ...) W_LOG(WC_LOG_APPLICATION, (_level), _fmt, ## __VA_ARGS__) 304 #define APP_EXDBG(_fmt, ...) APP_LOG(WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__) 305 #define APP_DBG( _fmt, ...) APP_LOG(WC_LOG_DEBUG, _fmt, ## __VA_ARGS__) 306 #define APP_INFO( _fmt, ...) APP_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__) 307 #define APP_NOT( _fmt, ...) APP_LOG(WC_LOG_NOTICE, _fmt, ## __VA_ARGS__) 308 #define APP_WARN( _fmt, ...) APP_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__) 309 #define APP_ERR( _fmt, ...) APP_LOG(WC_LOG_ERR, _fmt, ## __VA_ARGS__) 310 #define APP_CRIT( _fmt, ...) APP_LOG(WC_LOG_CRIT, _fmt, ## __VA_ARGS__) 311 #define APP_ALRT( _fmt, ...) APP_LOG(WC_LOG_ALERT, _fmt, ## __VA_ARGS__) 312 #define APP_EMRG( _fmt, ...) APP_LOG(WC_LOG_EMERG, _fmt, ## __VA_ARGS__)