mUPnP for C
log.h File Reference

Macros

#define MAX_LOG_STRING   2048
 
#define SEV_UNKNOWN_S   "Unknown"
 
#define SEV_ERROR   1
 
#define SEV_ERROR_S   "Error"
 
#define SEV_WARNING   2
 
#define SEV_WARNING_S   "Warning"
 
#define SEV_INFO   4
 
#define SEV_INFO_S   "Info"
 
#define SEV_DEBUG_L1   8
 
#define SEV_DEBUG_L1_S   "Debug (general)"
 
#define SEV_DEBUG_L2   16
 
#define SEV_DEBUG_L2_S   "Debug (stack)"
 
#define SEV_DEBUG_L3   32
 
#define SEV_DEBUG_L3_S   "Debug (application)"
 
#define SEV_DEBUG_L4   64
 
#define SEV_DEBUG_L4_S   "Debug (low level L4)"
 
#define SEV_DEBUG_L5   128
 
#define SEV_DEBUG_L5_S   "Debug (low level L5)"
 
#define SEV_ALL   (SEV_ERROR | SEV_WARNING | SEV_INFO | SEV_DEBUG_L1 | SEV_DEBUG_L2 | SEV_DEBUG_L3 | SEV_DEBUG_L4 | SEV_DEBUG_L5)
 
#define mupnp_log_error(format...)
 
#define mupnp_log_warning(format...)
 
#define mupnp_log_info(format...)
 
#define mupnp_log_debug(format...)
 
#define mupnp_log_debug_l4(format...)
 
#define mupnp_log_debug_l5(format...)
 
#define mupnp_log_debug_s(format...)
 
#define mupnp_log_debug_a(format...)
 

Functions

void mupnp_log_print (int severity, const char *file, int line_n, const char *function, const char *format,...)
 
void mupnp_log_set_separator (char *s)
 
int mupnp_log_add_target (char *target, int severity_mask)
 
int mupnp_log_clear_targets (void)
 

Macro Definition Documentation

◆ MAX_LOG_STRING

#define MAX_LOG_STRING   2048

◆ mupnp_log_debug

#define mupnp_log_debug ( format...)

◆ mupnp_log_debug_a

#define mupnp_log_debug_a ( format...)

◆ mupnp_log_debug_l4

#define mupnp_log_debug_l4 ( format...)

◆ mupnp_log_debug_l5

#define mupnp_log_debug_l5 ( format...)

◆ mupnp_log_debug_s

#define mupnp_log_debug_s ( format...)

◆ mupnp_log_error

#define mupnp_log_error ( format...)
Value:
mupnp_log_print(SEV_ERROR, __FILE__, __LINE__, __PRETTY_FUNCTION__, format)
#define SEV_ERROR
Definition log.h:24
void mupnp_log_print(int severity, const char *file, int line_n, const char *function, const char *format,...)
Definition log.c:193

◆ mupnp_log_info

#define mupnp_log_info ( format...)
Value:
mupnp_log_print(SEV_INFO, __FILE__, __LINE__, __PRETTY_FUNCTION__, format)
#define SEV_INFO
Definition log.h:30

◆ mupnp_log_warning

#define mupnp_log_warning ( format...)
Value:
mupnp_log_print(SEV_WARNING, __FILE__, __LINE__, __PRETTY_FUNCTION__, format)
#define SEV_WARNING
Definition log.h:27

◆ SEV_ALL

◆ SEV_DEBUG_L1

#define SEV_DEBUG_L1   8

◆ SEV_DEBUG_L1_S

#define SEV_DEBUG_L1_S   "Debug (general)"

◆ SEV_DEBUG_L2

#define SEV_DEBUG_L2   16

◆ SEV_DEBUG_L2_S

#define SEV_DEBUG_L2_S   "Debug (stack)"

◆ SEV_DEBUG_L3

#define SEV_DEBUG_L3   32

◆ SEV_DEBUG_L3_S

#define SEV_DEBUG_L3_S   "Debug (application)"

◆ SEV_DEBUG_L4

#define SEV_DEBUG_L4   64

◆ SEV_DEBUG_L4_S

#define SEV_DEBUG_L4_S   "Debug (low level L4)"

◆ SEV_DEBUG_L5

#define SEV_DEBUG_L5   128

◆ SEV_DEBUG_L5_S

#define SEV_DEBUG_L5_S   "Debug (low level L5)"

◆ SEV_ERROR

#define SEV_ERROR   1

◆ SEV_ERROR_S

#define SEV_ERROR_S   "Error"

◆ SEV_INFO

#define SEV_INFO   4

◆ SEV_INFO_S

#define SEV_INFO_S   "Info"

◆ SEV_UNKNOWN_S

#define SEV_UNKNOWN_S   "Unknown"

◆ SEV_WARNING

#define SEV_WARNING   2

◆ SEV_WARNING_S

#define SEV_WARNING_S   "Warning"

Function Documentation

◆ mupnp_log_add_target()

int mupnp_log_add_target ( char * target,
int mask )

Add new logging target

Parameters
targetString identifying the logging target (Currently stdout|stderr|FILENAME)
maskBitmask defining what messages are to be printed into this target

◆ mupnp_log_clear_targets()

int mupnp_log_clear_targets ( void )

Clear target list

◆ mupnp_log_print()

void mupnp_log_print ( int severity,
const char * file,
int line_n,
const char * function,
const char * format,
... )

Multiplex log messages into different targets (streams), should be used via convenience macros

Parameters
severityMessage severity
fileFile name where the function is called
line_nLine number where the function is called
functionFunction name where this function is called
formatFormat string for the actual log message
...Possible parameters for the format string

◆ mupnp_log_set_separator()

void mupnp_log_set_separator ( char * s)

Set log item separator

Parameters
sString to use as a log item separator