Debug


Defines

#define debug_printf(dp, format, ARGS...)   debug_printf_real(dp,__FILE__,__LINE__,__FUNCTION__,format,##ARGS)

Typedefs

typedef enum _DebugLevel DebugLevel

Enumerations

enum  _DebugLevel { DEBUG_NO_OUTPUT = 0, DEBUG_ERROR = 1, DEBUG_WARNING = 2, DEBUG_INFO = 3 }

Functions

void debug_set_level (DebugLevel dl)
void debug_printf_real (DebugLevel dp, const char *file, const int line, const char *function, const char *format,...)
void debug_set_output (FILE *fp)

Define Documentation

#define debug_printf ( dp,
format,
ARGS...   )     debug_printf_real(dp,__FILE__,__LINE__,__FUNCTION__,format,##ARGS)

Parameters:
dp The debug level the message is at.
format a printf style string
ARGS arguments for format

Definition at line 55 of file debug_printf.h.


Typedef Documentation

typedef enum _DebugLevel DebugLevel


Enumeration Type Documentation

Enumerator:
DEBUG_NO_OUTPUT  No debug output
DEBUG_ERROR  Print only error messages
DEBUG_WARNING  Print Error and Warning messages
DEBUG_INFO  Print only error message

Definition at line 29 of file debug_printf.h.


Function Documentation

void debug_printf_real ( DebugLevel  dp,
const char *  file,
const int  line,
const char *  function,
const char *  format,
  ... 
)

Internal function, do no use

void debug_set_level ( DebugLevel  dl  ) 

Parameters:
dl a DebugLevel
Set the debug level. if set to DEBUG_INFO everything is printed to stdout.

void debug_set_output ( FILE *  fp  ) 

Parameters:
fp a FILE
Redirect the output from stdout to fp. Set to NULL, to revert back to stdout.


Copyright 2006 Qball Cow