#ifndef s11n_DEBUGGERING_MACROS_H #define s11n_DEBUGGERING_MACROS_H 1 // CERR is a drop-in replacement for std::cerr, but slightly more // decorative. #ifndef CERR #define CERR std::cerr << __FILE__ << ":" << std::dec << __LINE__ << " : " #endif #ifndef COUT #define COUT std::cout << __FILE__ << ":" << std::dec << __LINE__ << " : " #endif #include //////////////////////////////////////////////////////////////////////// // Debuggering/tracing macros for the s11n internals... // The xxx_PROFILE_xxx macros are NOT part of the API: // they are to allow me to quickly switch between various // debuggering modes. #define S11N_TRACE_PROFILE_QUIET (::s11n::debug::TRACE_NEVER) #define S11N_TRACE_PROFILE_DEFAULT (::s11n::debug::TRACE_ERROR | ::s11n::debug::TRACE_WARNING ) #define S11N_TRACE_PROFILE_MAINTAINER (S11N_TRACE_PROFILE_DEFAULT | ::s11n::debug::TRACE_FACTORY ) //////////////////////////////////////////////////////////////////////// // S11N_TRACE_LEVELS defines the default, compiled-in tracing level // When set to 0 (TRACE_NONE), tracing will be unavailable even if // trace_mask() is later used to change it, and a smart compiler will // optimize out all such S11N_TRACE calls. #ifndef S11N_TRACE_LEVELS // allow client code to change compile-time default //# define S11N_TRACE_LEVELS (S11N_TRACE_PROFILE_MAINTAINER) # define S11N_TRACE_LEVELS (S11N_TRACE_PROFILE_DEFAULT) #endif // The S11N_TRACE macro is described in the s11n::debug namespace docs #define S11N_TRACE(LVL) if((S11N_TRACE_LEVELS) && ((LVL) & ::s11n::debug::trace_mask())) \ ::s11n::debug::trace_stream() << "S11N_TRACE["<<# LVL<<"]: "<<__FILE__<<":"<