33 #include <boost/format.hpp> 34 #include <boost/thread/mutex.hpp> 35 #include <boost/thread/condition.hpp> 36 #include <boost/date_time/posix_time/posix_time.hpp> 44 Debug(std::string _unit_name = std::string(
"UNKNOWN")) {
49 Debug(
const char * _unit_name_cstr) {
54 Debug(
unsigned int _debug_level, std::string _unit_name = std::string(
"UNKNOWN")) {
59 Debug(
unsigned int _debug_level,
const char * _unit_name_cstr) {
64 void debugMsg(
const std::string &
msg,
unsigned int threshold = 1) {
71 void debugMsg(
const boost::format & fmt,
unsigned int threshold = 1) {
76 debugMsg(std::string(msg), threshold);
93 boost::posix_time::ptime t1;
94 t1 = boost::posix_time::microsec_clock::local_time();
95 return to_simple_string(t1);
static unsigned int getGlobalLevel()
std::string curDateTime()
Debug(const char *_unit_name_cstr)
void debugMsg(const std::string &msg, unsigned int threshold=1)
std::string unit_name
the name of the unit reporting status
void debugMsg(const char *msg, unsigned int threshold=1)
Debug(unsigned int _debug_level, const char *_unit_name_cstr)
static unsigned int global_debug_level
Debug(std::string _unit_name=std::string("UNKNOWN"))
Debug(unsigned int _debug_level, std::string _unit_name=std::string("UNKNOWN"))
void debugMsg(const boost::format &fmt, unsigned int threshold=1)
unsigned int debug_level
the debug level (threshold) for messages
static unsigned int default_debug_level
A simple base class to provide debug messaging from any derived class.
static void setDefaultLevel(unsigned int v)
static boost::mutex debug_msg_mutex
static void setGlobalLevel(unsigned int v)
void setDebugLevel(unsigned int v)
static unsigned int getDefaultLevel()
unsigned int getDebugLevel()