29 #include <boost/call_traits.hpp> 30 #include <boost/ref.hpp> 31 #include <miaconfig.h> 38 #ifndef VSTREAM_DOMAIN 39 #define VSTREAM_DOMAIN "**" 83 void set_verbosity(
Level l);
93 std::ostream& set_stream(std::ostream& os);
101 bool shows(
Level l)
const;
104 bool show_debug()
const;
119 if (m_message_level >= m_output_level)
136 static void set_output_target(std::ostream* os);
141 operator std::ostream& () {
148 static std::ostream* m_output_target;
149 static __thread std::ostream* m_output;
150 Level m_output_level;
151 static __thread
Level m_message_level;
174 return l >= m_output_level;
182 m_fill(m_depth,
' ') {
184 << m_fill <<
"enter " << m_domain <<
"\n";
189 << m_fill <<
"leave " << m_domain <<
"\n";
193 const char *m_domain;
196 static __thread
size_t m_depth;
200 #ifndef ENABLE_DEBUG_MESSAGES 201 #define TRACE(DOMAIN) 202 #define TRACE_FUNCTION 203 #define FUNCTION_NOT_TESTED 237 #define TRACE(DOMAIN) ::mia::CTrace _xxx_trace(DOMAIN) 240 #define TRACE_FUNCTION ::mia::CTrace _xxx_trace(__PRETTY_FUNCTION__) 243 #define FUNCTION_NOT_TESTED ::mia::cvwarn() << __PRETTY_FUNCTION__ << ":not tested\n" 260 return shows(ml_debug);
267 return m_output_level;
331 #define cverb ::mia::vstream::instance() 337 template <
typename T>
338 vstream& operator << (vstream& os, const std::vector<T>& v) {
340 for (
auto i =v.begin(); i != v.end(); ++i)
A output stream to enable certain levels of verbosity.
vstream & cvinfo()
informal output that may be of interest to understand problems with a program and are of higher prior...
vstream & cverr()
send errors to this stream adapter
CTrace(const char *domain)
bool shows(Level l) const
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
vstream & operator<<(vstream &os, const std::vector< T > &v)
implements the direct streaming of std::vectors.
vstream::Level get_level() const
vstream & cvmsg()
send messages to this stream adapter
static vstream & instance()
void set_verbose(bool verbose)
vstream & cvwarn()
send warnings to this stream adapter
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
CDebugSink & operator<<(std::ostream &(*)(std::ostream &))
void flush()
write pending output
vstream & cvfatal()
direct output to this stream adapter to print out fatalities in the code
vstream & cvfail()
direct output to this stream adapter to print out failtures in tests beyond BOOST_FAIL ...
EXPORT_CORE const TDictMap< vstream::Level > g_verbose_dict
Dictonary for the verbosity of the logging as used by –verbose comand line option.
A mapper from emums to string values. - usefull for names flags.
#define NS_MIA_END
conveniance define to end the mia namespace