ROX-CLib: rox_debug.h File Reference

- Main Page
- Data Structures
- Files
- Related Pages

- File List
- Globals

# rox_debug.h File Reference

Standard debug output. More...

## Defines
#define | dprintf rox_debug_printf
## Functions
void | rox_debug_init (const char *progname)
void | rox_debug_printf (int level, const char *fmt,...)

## Detailed Description

Standard debug output.

Unless the pre-processer symbol `DEBUG` is defined as non-zero before rox_debug.h is included then the functions here are defined to be no-operations.

Author:
  Stephen Watson

Version:
  Id
    rox_debug.h,v 1.3 2005/08/21 13:06:38 stephen Exp

## Define Documentation

#define dprintf rox_debug_printf

An alias for rox_debug_printf() to save typing.

## Function Documentation

void rox_debug_init | ( | const char * | progname | ) |

Initialize the debug system. This is normally called by rox_init() or rox_init_with_domain(). The program name is forced to all upper case and appended with "_DEBUG_LEVEL" to obtain a environment variable name, so that "Clock" becomes "CLOCK_DEBUG_LEVEL". If that variable exists it is interpreted as an integer value and used as the debug level if it is greater than zero. Otherwise the debug level is set to zero.

Parameters:

  `[in]` | progname | program name

void rox_debug_printf | ( | int | level,
|  | const char * | fmt,
|  |  | ... |
| ) |  |  |

Format printf-like arugments and send the result to stderr (using g_logv()) if the level is less than or equal to the current debug level.

Parameters:

  `[in]` | level | the level of the message (0 will always be seen).
  `[in]` | fmt | a printf()-like format string
  `[in]` | ... | arguments to the format string