12 #define SSTR(message) static_cast<std::ostringstream&>(std::ostringstream().flush() << message).str() 14 #define Log(lvl, mymask, where, what) \ 16 if (Logger::get()->getLevel() >= lvl && Logger::get()->isLogged(mymask)) \ 18 std::ostringstream outs; \ 19 outs << "[" << lvl << "] dmlite " << where << " " << __func__ << " : " << what; \ 20 Logger::get()->log((Logger::Level)lvl, outs.str()); \ 25 #define Err(where, what) \ 27 std::ostringstream outs; \ 28 outs << "dmlite " << where << " !! " << __func__ << " : " << what; \ 29 Logger::get()->log((Logger::Level)0, outs.str()); \ 105 void setLogged(component
const &comp,
bool tobelogged);
114 void log(
Level lvl, std::string
const & msg)
const;
130 bitmask
getMask(component
const & comp);
void log(Level lvl, std::string const &msg) const
static bitmask unregistered
Definition: logger.h:44
bool isLogged(bitmask m) const
Definition: logger.h:90
void registerComponents(std::vector< component > const &components)
std::map< component, bitmask > mapping
component name to bitmask mapping
Definition: logger.h:159
bitmask getMask(component const &comp)
static Logger * instance
Definition: logger.h:62
short getLevel() const
Definition: logger.h:78
int size
number of components that were assigned with a bitmask
Definition: logger.h:155
void setLogged(component const &comp, bool tobelogged)
unsigned long long bitmask
typedef for a bitmask (long long)
Definition: logger.h:40
short level
current log level
Definition: logger.h:153
void logAll()
Definition: logger.h:120
Logger & operator=(Logger const &)
void setLevel(Level lvl)
Definition: logger.h:84
bitmask mask
global bitmask with all registered components
Definition: logger.h:157
std::string component
typedef for a component name (std:string)
Definition: logger.h:42
void LogCfgParm(int lvl, Logger::bitmask mymask, std::string where, std::string key, std::string value)
void registerComponent(component const &comp)
Level
Definition: logger.h:49
Logger()
Private constructor.
static char * unregisteredname
Definition: logger.h:45
static int getStackTrace(std::string &s)