Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

rox_debug.c File Reference

Standard debug output. More...

#include "rox-clib.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "rox_debug.h"

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.c,v 1.4 2005/09/10 16:15:38 stephen Exp

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


Generated on Sat Oct 22 17:49:14 2005 for ROX-CLib by doxygen 1.3.8