Webcom C SDK
Macros | Typedefs | Enumerations | Functions
webcom-log.h File Reference
#include "webcom-config.h"
#include <syslog.h>
Include dependency graph for webcom-log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define W_LOG(_facility, _level, _fmt, ...)
 
#define W_EXDBG(_facility, _fmt, ...)   W_LOG((_facility), WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__)
 
#define W_DBG( _facility, _fmt, ...)   W_LOG((_facility), WC_LOG_DEBUG, _fmt, ## __VA_ARGS__)
 
#define W_INFO(_facility, _fmt, ...)   W_LOG((_facility), WC_LOG_INFO, _fmt, ## __VA_ARGS__)
 
#define W_NOT( _facility, _fmt, ...)   W_LOG((_facility), WC_LOG_NOTICE, _fmt, ## __VA_ARGS__)
 
#define W_WARN(_facility, _fmt, ...)   W_LOG((_facility), WC_LOG_INFO, _fmt, ## __VA_ARGS__)
 
#define W_ERR( _facility, _fmt, ...)   W_LOG((_facility), WC_LOG_ERR, _fmt, ## __VA_ARGS__)
 
#define W_CRIT(_facility, _fmt, ...)   W_LOG((_facility), WC_LOG_CRIT, _fmt, ## __VA_ARGS__)
 
#define W_ALRT(_facility, _fmt, ...)   W_LOG((_facility), WC_LOG_ALERT, _fmt, ## __VA_ARGS__)
 
#define W_EMRG(_facility, _fmt, ...)   W_LOG((_facility), WC_LOG_EMERG, _fmt, ## __VA_ARGS__)
 
#define LOCAL_LOG_FACILITY   WC_LOG_GENERAL
 
#define WL_LOG(_level, _fmt, ...)   W_LOG(LOCAL_LOG_FACILITY, (_level), _fmt, ## __VA_ARGS__)
 
#define WL_EXDBG(_fmt, ...)   WL_LOG(WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__)
 
#define WL_DBG( _fmt, ...)   WL_LOG(WC_LOG_DEBUG, _fmt, ## __VA_ARGS__)
 
#define WL_INFO(_fmt, ...)   WL_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)
 
#define WL_NOT( _fmt, ...)   WL_LOG(WC_LOG_NOTICE, _fmt, ## __VA_ARGS__)
 
#define WL_WARN(_fmt, ...)   WL_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)
 
#define WL_ERR( _fmt, ...)   WL_LOG(WC_LOG_ERR, _fmt, ## __VA_ARGS__)
 
#define WL_CRIT(_fmt, ...)   WL_LOG(WC_LOG_CRIT, _fmt, ## __VA_ARGS__)
 
#define WL_ALRT(_fmt, ...)   WL_LOG(WC_LOG_ALERT, _fmt, ## __VA_ARGS__)
 
#define WL_EMRG(_fmt, ...)   WL_LOG(WC_LOG_EMERG, _fmt, ## __VA_ARGS__)
 
#define APP_LOG(_level, _fmt, ...)   W_LOG(WC_LOG_APPLICATION, (_level), _fmt, ## __VA_ARGS__)
 
#define APP_EXDBG(_fmt, ...)   APP_LOG(WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__)
 
#define APP_DBG( _fmt, ...)   APP_LOG(WC_LOG_DEBUG, _fmt, ## __VA_ARGS__)
 
#define APP_INFO(_fmt, ...)   APP_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)
 
#define APP_NOT( _fmt, ...)   APP_LOG(WC_LOG_NOTICE, _fmt, ## __VA_ARGS__)
 
#define APP_WARN(_fmt, ...)   APP_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)
 
#define APP_ERR( _fmt, ...)   APP_LOG(WC_LOG_ERR, _fmt, ## __VA_ARGS__)
 
#define APP_CRIT(_fmt, ...)   APP_LOG(WC_LOG_CRIT, _fmt, ## __VA_ARGS__)
 
#define APP_ALRT(_fmt, ...)   APP_LOG(WC_LOG_ALERT, _fmt, ## __VA_ARGS__)
 
#define APP_EMRG(_fmt, ...)   APP_LOG(WC_LOG_EMERG, _fmt, ## __VA_ARGS__)
 

Typedefs

typedef void(* wc_log_f) (const char *f, const char *l, const char *file, const char *func, int line, const char *message)
 

Enumerations

enum  wc_log_facility {
  WC_LOG_WEBSOCKET, WC_LOG_PARSER, WC_LOG_CONNECTION, WC_LOG_MESSAGE,
  WC_LOG_GENERAL, WC_LOG_APPLICATION, WC_LOG_AUTH, WC_LOG_ALL
}
 
enum  wc_log_level {
  WC_LOG_EMERG, WC_LOG_ALERT, WC_LOG_CRIT, WC_LOG_ERR,
  WC_LOG_WARNING, WC_LOG_NOTICE, WC_LOG_INFO, WC_LOG_DEBUG,
  WC_LOG_EXTRADEBUG, WC_LOG_DISABLED
}
 

Functions

void wc_set_log_level (enum wc_log_facility f, enum wc_log_level l)
 
void wc_log_use_syslog (const char *ident, int option, int facility)
 
void wc_log_use_journald (void)
 
void wc_log_use_stderr (void)
 
void wc_log_use_custom (wc_log_f f)
 
void wc_log (enum wc_log_facility f, enum wc_log_level l, const char *file, const char *func, int line, const char *fmt,...) __attribute__((format(printf
 

Macro Definition Documentation

◆ APP_ALRT

#define APP_ALRT (   _fmt,
  ... 
)    APP_LOG(WC_LOG_ALERT, _fmt, ## __VA_ARGS__)

◆ APP_CRIT

#define APP_CRIT (   _fmt,
  ... 
)    APP_LOG(WC_LOG_CRIT, _fmt, ## __VA_ARGS__)

◆ APP_DBG

#define APP_DBG (   _fmt,
  ... 
)    APP_LOG(WC_LOG_DEBUG, _fmt, ## __VA_ARGS__)

◆ APP_EMRG

#define APP_EMRG (   _fmt,
  ... 
)    APP_LOG(WC_LOG_EMERG, _fmt, ## __VA_ARGS__)

◆ APP_ERR

#define APP_ERR (   _fmt,
  ... 
)    APP_LOG(WC_LOG_ERR, _fmt, ## __VA_ARGS__)

◆ APP_EXDBG

#define APP_EXDBG (   _fmt,
  ... 
)    APP_LOG(WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__)

◆ APP_INFO

#define APP_INFO (   _fmt,
  ... 
)    APP_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)

◆ APP_NOT

#define APP_NOT (   _fmt,
  ... 
)    APP_LOG(WC_LOG_NOTICE, _fmt, ## __VA_ARGS__)

◆ APP_WARN

#define APP_WARN (   _fmt,
  ... 
)    APP_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)

◆ LOCAL_LOG_FACILITY

#define LOCAL_LOG_FACILITY   WC_LOG_GENERAL

◆ W_ALRT

#define W_ALRT (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_ALERT, _fmt, ## __VA_ARGS__)

◆ W_CRIT

#define W_CRIT (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_CRIT, _fmt, ## __VA_ARGS__)

◆ W_DBG

#define W_DBG (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_DEBUG, _fmt, ## __VA_ARGS__)

◆ W_EMRG

#define W_EMRG (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_EMERG, _fmt, ## __VA_ARGS__)

◆ W_ERR

#define W_ERR (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_ERR, _fmt, ## __VA_ARGS__)

◆ W_EXDBG

#define W_EXDBG (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__)

◆ W_INFO

#define W_INFO (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_INFO, _fmt, ## __VA_ARGS__)

◆ W_NOT

#define W_NOT (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_NOTICE, _fmt, ## __VA_ARGS__)

◆ W_WARN

#define W_WARN (   _facility,
  _fmt,
  ... 
)    W_LOG((_facility), WC_LOG_INFO, _fmt, ## __VA_ARGS__)

◆ WL_ALRT

#define WL_ALRT (   _fmt,
  ... 
)    WL_LOG(WC_LOG_ALERT, _fmt, ## __VA_ARGS__)

◆ WL_CRIT

#define WL_CRIT (   _fmt,
  ... 
)    WL_LOG(WC_LOG_CRIT, _fmt, ## __VA_ARGS__)

◆ WL_DBG

#define WL_DBG (   _fmt,
  ... 
)    WL_LOG(WC_LOG_DEBUG, _fmt, ## __VA_ARGS__)

◆ WL_EMRG

#define WL_EMRG (   _fmt,
  ... 
)    WL_LOG(WC_LOG_EMERG, _fmt, ## __VA_ARGS__)

◆ WL_ERR

#define WL_ERR (   _fmt,
  ... 
)    WL_LOG(WC_LOG_ERR, _fmt, ## __VA_ARGS__)

◆ WL_EXDBG

#define WL_EXDBG (   _fmt,
  ... 
)    WL_LOG(WC_LOG_EXTRADEBUG, _fmt, ## __VA_ARGS__)

◆ WL_INFO

#define WL_INFO (   _fmt,
  ... 
)    WL_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)

◆ WL_NOT

#define WL_NOT (   _fmt,
  ... 
)    WL_LOG(WC_LOG_NOTICE, _fmt, ## __VA_ARGS__)

◆ WL_WARN

#define WL_WARN (   _fmt,
  ... 
)    WL_LOG(WC_LOG_INFO, _fmt, ## __VA_ARGS__)