oRTP  0.23.0
Macros | Typedefs | Enumerations | Functions | Variables
logging.h File Reference

Logging API. More...

#include <ortp/port.h>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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(...)
 

Typedefs

typedef void(* OrtpLogFunc) (OrtpLogLevel lev, const char *fmt, va_list args)
 

Enumerations

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
}
 

Functions

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)
 

Variables

ORTP_VAR_PUBLIC OrtpLogFunc ortp_logv_out
 
static void const char * fmt
 

Detailed Description

Logging API.

Macro Definition Documentation

◆ 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)

Function Documentation

◆ ortp_set_log_file()

ORTP_PUBLIC void ortp_set_log_file ( FILE *  file)
Parameters
filea FILE pointer where to output the ortp logs.

◆ ortp_set_log_handler()

ORTP_PUBLIC void ortp_set_log_handler ( OrtpLogFunc  func)
Parameters
funcyour 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   
)
Initial value:
{
va_list args