29 #include <boost/call_traits.hpp>
35 #ifndef VSTREAM_DOMAIN
36 #define VSTREAM_DOMAIN "**"
41 std::ostream& operator << (std::ostream& os, const std::vector<T>& v)
90 void set_verbosity(Level l);
100 std::ostream& set_stream(std::ostream& os);
108 bool shows(Level l)
const;
111 bool show_debug()
const;
126 if (m_message_level >= m_output_level)
143 static void set_output_target(std::ostream* os);
148 operator std::ostream& () {
153 vstream(std::ostream& output, Level l);
155 static std::ostream* m_output_target;
156 static __thread std::ostream* m_output;
157 Level m_output_level;
158 static __thread Level m_message_level;
181 return l >= m_output_level;
186 #define TRACE(DOMAIN)
187 #define TRACE_FUNCTION
188 #define FUNCTION_NOT_TESTED
195 CDebugSink &
operator<<(std::ostream& (* )(std::ostream&)) {
202 static CDebugSink sink;
223 m_fill(m_depth,
' ') {
225 << m_fill <<
"enter " << m_domain <<
"\n";
230 << m_fill <<
"leave " << m_domain <<
"\n";
234 const char *m_domain;
237 static __thread
size_t m_depth;
241 #define TRACE(DOMAIN) ::mia::CTrace _xxx_trace(DOMAIN)
244 #define TRACE_FUNCTION ::mia::CTrace _xxx_trace(__PRETTY_FUNCTION__)
247 #define FUNCTION_NOT_TESTED ::mia::cvwarn() << __PRETTY_FUNCTION__ << ":not tested\n"
271 return m_output_level;
335 #define cverb ::mia::vstream::instance()
341 template <
typename T>
342 vstream& operator << (vstream& os, const std::vector<T>& v) {
344 for (
auto i =v.begin(); i != v.end(); ++i)