This file defines a couple of macros and classes/typedefs that make it easier to implement switchable debug messages:
So, the way to use this header is simple. Include it, and use PDEBUG() to write debug messages and PVDEBUG() to write verbose debug messages. In case you want to use something resembling a std::ostream, use an instance of estar::debugos or estar::vdebugos, but then after filling them with messages you have to explicitly print their str().c_str() using PDEBUG() or PVDEBUG().
#include <string>
#include <stdio.h>
Include dependency graph for pdebug.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | estar |
Classes | |
class | estar::fakeos |
Utility for compile-time switchable debug messages. More... | |
Defines | |
#define | PDEBUG_ERR(fmt, arg...) fprintf(stderr, "%s(): "fmt, __func__, ## arg) |
#define | PDEBUG_OUT(fmt, arg...) fprintf(stdout, "%s(): "fmt, __func__, ## arg) |
#define | PDEBUG_OFF(fmt, arg...) |
#define | PVDEBUG PDEBUG_OFF |
#define | PDEBUG PDEBUG_OFF |
Typedefs | |
typedef fakeos | estar::vdebugos |
typedef fakeos | estar::debugos |
#define PDEBUG PDEBUG_OFF |
#define PDEBUG_ERR | ( | fmt, | |||
arg... | ) | fprintf(stderr, "%s(): "fmt, __func__, ## arg) |
#define PDEBUG_OFF | ( | fmt, | |||
arg... | ) |
#define PDEBUG_OUT | ( | fmt, | |||
arg... | ) | fprintf(stdout, "%s(): "fmt, __func__, ## arg) |
#define PVDEBUG PDEBUG_OFF |