Defines | Enumerations | Functions

src/Debug.h File Reference

Basic debugging utility macros. More...

#include <stdio.h>
#include <stdarg.h>
Include dependency graph for Debug.h:

Go to the source code of this file.

Defines

#define STRX(x)   #x
 Stringify number-valued preprocessor defines like __LINE__.
#define dprintf(level,...)   _dprintf(level, __FILE__ ":" STR(__LINE__), __VA_ARGS__)
 Printf-like debugging macro, which fills the source argument of _dprintf using the file name and line number.

Enumerations

enum  debugLevel
 

Encoding of the error levels described above.

More...

Functions

void _dprintf (int, const char *, const char *,...)
 Raw printf-like debugging fuction.

Detailed Description

Basic debugging utility macros.

These cannot be placed in the FCam namespace, being macros, so this header is not included by default by any part of the FCam public interface. Feel free to include it if you wish to use it, but be aware of the possibility of namespace pollution. To enable debugging, define DEBUG before including this header.

Definition in file Debug.h.


Define Documentation

#define dprintf (   level,
  ... 
)    _dprintf(level, __FILE__ ":" STR(__LINE__), __VA_ARGS__)

Printf-like debugging macro, which fills the source argument of _dprintf using the file name and line number.

Definition at line 66 of file Debug.h.


Enumeration Type Documentation

enum debugLevel

Encoding of the error levels described above.

Use these for the dprintf level argument, and then set FCAM_DEBUG_LEVEL to the desired runtime verbosity.

Definition at line 30 of file Debug.h.


Function Documentation

void _dprintf ( int  ,
const char *  ,
const char *  ,
  ... 
) [inline]

Raw printf-like debugging fuction.

It has a verbosity level(lower=more verbose), controlled by FCAM_DEBUG_LEVEL, and a source string as arguments, beyond the usual printf-style fields. An empty function if DEBUG is not defined.

Definition at line 62 of file Debug.h.