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)
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::Level get_level() const
vstream & cvmsg()
send messages to this stream adapter
static vstream & instance()
vstream & cvdebug()
Short for debug output in non-debug build output send to this will be ignored.
void set_verbose(bool verbose)
vstream & cvwarn()
send warnings to this stream adapter
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
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.
std::ostream & operator<<(std::ostream &os, const CAttribute &attr)
A mapper from emums to string values. - usefull for names flags.
#define NS_MIA_END
conveniance define to end the mia namespace