22 #ifndef OR_INTERNALS_TRACE_H_ 23 #define OR_INTERNALS_TRACE_H_ 29 #include <libopenraw/debug.h> 37 void log(debug_level level,
const char* fmt, ...)
38 __attribute__ ((format (printf, 2, 3)));
41 #define LOGWARN(...) \ 42 Debug::log(WARNING, ## __VA_ARGS__) 45 Debug::log(ERROR, ## __VA_ARGS__) 47 #define LOGDBG1(...) \ 48 Debug::log(DEBUG1, ## __VA_ARGS__) 50 #define LOGDBG2(...) \ 51 Debug::log(DEBUG2, ## __VA_ARGS__) 57 Trace(debug_level level)
61 Trace & operator<<(
int i);
62 Trace & operator<<(
const char * s);
63 Trace & operator<<(
void *);
64 Trace & operator<<(
const std::string & s);
67 Trace & operator<<(const std::vector<T> & v);
69 static void setDebugLevel(debug_level lvl);
71 friend void log(debug_level level,
const char* fmt, ...);
72 static void print(
int i);
73 static int debugLevel;
79 Trace & Trace::operator<<(const std::vector<T> & v)
81 if (m_level <= debugLevel) {
82 std::for_each(v.cbegin(), v.cend(),
friend void log(debug_level level, const char *fmt,...)