Logging API.
More...
#include <ortp/port.h>
Go to the source code of this file.
|
#define | ortp_log_level_enabled(level) (ortp_get_log_level_mask() & (level)) |
|
#define | ortp_logv(level, fmt, args) |
|
#define | CHECK_FORMAT_ARGS(m, n) |
|
#define | ortp_debug(...) |
|
|
typedef void(* | OrtpLogFunc) (OrtpLogLevel lev, const char *fmt, va_list args) |
|
|
enum | OrtpLogLevel {
ORTP_DEBUG =1,
ORTP_MESSAGE =1<<1,
ORTP_WARNING =1<<2,
ORTP_ERROR =1<<3,
ORTP_FATAL =1<<4,
ORTP_TRACE =1<<5,
ORTP_LOGLEV_END =1<<6
} |
|
|
ORTP_PUBLIC void | ortp_set_log_file (FILE *file) |
|
ORTP_PUBLIC void | ortp_set_log_handler (OrtpLogFunc func) |
|
ORTP_PUBLIC void | ortp_set_log_level_mask (int levelmask) |
|
ORTP_PUBLIC int | ortp_get_log_level_mask (void) |
|
static void const char | va_start (args, fmt) |
|
| ortp_logv (lev, fmt, args) |
|
| va_end (args) |
|
| ortp_logv (ORTP_MESSAGE, fmt, args) |
|
| ortp_logv (ORTP_WARNING, fmt, args) |
|
| ortp_logv (ORTP_ERROR, fmt, args) |
|
| ortp_logv (ORTP_FATAL, fmt, args) |
|
|
ORTP_VAR_PUBLIC OrtpLogFunc | ortp_logv_out |
|
static void const char * | fmt |
|
◆ ortp_logv
#define ortp_logv |
( |
|
level, |
|
|
|
fmt, |
|
|
|
args |
|
) |
| |
Value:{\
if (ortp_logv_out!=NULL && ortp_log_level_enabled(level)) \
ortp_logv_out(level,fmt,args);\
if ((level)==ORTP_FATAL) abort();\
}while(0)
◆ ortp_set_log_file()
ORTP_PUBLIC void ortp_set_log_file |
( |
FILE * |
file | ) |
|
- Parameters
-
file | a FILE pointer where to output the ortp logs. |
◆ ortp_set_log_handler()
ORTP_PUBLIC void ortp_set_log_handler |
( |
OrtpLogFunc |
func | ) |
|
- Parameters
-
func | your logging function, compatible with the OrtpLogFunc prototype. |
◆ ortp_set_log_level_mask()
ORTP_PUBLIC void ortp_set_log_level_mask |
( |
int |
levelmask | ) |
|
@ param levelmask a mask of ORTP_DEBUG, ORTP_MESSAGE, ORTP_WARNING, ORTP_ERROR ORTP_FATAL .
◆ va_start()
static void va_start |
( |
args |
, |
|
|
fmt |
|
|
) |
| |