Debug

Debug — Printing and formatting debug information

Functions

void (*OilDebugPrintFunc) ()
void oil_debug_set_print_function ()
int oil_debug_get_level ()
void oil_debug_set_level ()
#define OIL_ERROR()
#define OIL_WARNING()
#define OIL_INFO()
#define OIL_DEBUG()
#define OIL_LOG()
#define OIL_DEBUG_PRINT()

Types and Values

Description

Functions

OilDebugPrintFunc ()

void
(*OilDebugPrintFunc) (int level,
                      const char *file,
                      const char *func,
                      int line,
                      const char *format,
                      va_list varargs);

Typedef describing functions that can be registered using oil_debug_set_print_function() so that it is called to print debugging messages.

Parameters

level

the debug level

 

file

name of the file where the debug message occurs

 

func

name of the function where the debug message occurs

 

line

line in the file where the debug message occurs

 

format

a printf format

 

varargs

varargs for the printf format

 

oil_debug_set_print_function ()

void
oil_debug_set_print_function (OilDebugPrintFunc func);

Sets the function to call when outputting debugging information. A value of NULL for func will restore the default handler, which prints debugging information to stderr.


oil_debug_get_level ()

int
oil_debug_get_level (void);

Gets the current debug level.

Returns

the current debug level


oil_debug_set_level ()

void
oil_debug_set_level (int level);

Sets the current debug level.

Parameters

level

the new debug level

 

OIL_ERROR()

#define OIL_ERROR(...) OIL_DEBUG_PRINT(OIL_DEBUG_ERROR, __VA_ARGS__)

Macro to call OIL_DEBUG_PRINT() with a level of OIL_DEBUG_ERROR.


OIL_WARNING()

#define OIL_WARNING(...) OIL_DEBUG_PRINT(OIL_DEBUG_WARNING, __VA_ARGS__)

Macro to call OIL_DEBUG_PRINT() with a level of OIL_DEBUG_WARNING.


OIL_INFO()

#define OIL_INFO(...) OIL_DEBUG_PRINT(OIL_DEBUG_INFO, __VA_ARGS__)

Macro to call OIL_DEBUG_PRINT() with a level of OIL_DEBUG_INFO.


OIL_DEBUG()

#define OIL_DEBUG(...) OIL_DEBUG_PRINT(OIL_DEBUG_DEBUG, __VA_ARGS__)

Macro to call OIL_DEBUG_PRINT() with a level of OIL_DEBUG_DEBUG.


OIL_LOG()

#define OIL_LOG(...) OIL_DEBUG_PRINT(OIL_DEBUG_LOG, __VA_ARGS__)

Macro to call OIL_DEBUG_PRINT() with a level of OIL_DEBUG_LOG.


OIL_DEBUG_PRINT()

#define             OIL_DEBUG_PRINT(level, ...)

Macro to call oil_debug_print() with the correct values for the name of the source file, line of source file, and function.

Types and Values

enum OilDebugLevel

Enumeration describing debug levels in Liboil.

Members

OIL_DEBUG_NONE

   

OIL_DEBUG_ERROR

   

OIL_DEBUG_WARNING

   

OIL_DEBUG_INFO

   

OIL_DEBUG_DEBUG

   

OIL_DEBUG_LOG

   

OIL_FUNCTION

#define OIL_FUNCTION __PRETTY_FUNCTION__

Internal macro that points to __PRETTY_FUNCTION__ or __func__ if the former is not available.