16 Logger(QtMsgType level, const char* msg) :
20 if (matchLogLevel(level)) {
22 QDebug(QtDebugMsg) << msg << "enter";
27 if (matchLogLevel(level)) {
28 QDebug(level) << msg << "exit, elapsed:" << time.elapsed() << "ms";
32 /** Test if given logging level matches with application logging level
33 * Application logging level exists as "LogLevel" entry in Situare.conf
39 * QtSystemMsg -> QtCriticalMsg -> 2
42 static bool matchLogLevel(QtMsgType level)
44 static const QSettings settings(SETTINGS_ORGANIZATION_NAME, SETTINGS_APPLICATION_NAME);
45 static QtMsgType LOG_LEVEL = static_cast<QtMsgType>(settings.value("LogLevel", (int)QtSystemMsg).toInt());
46 return LOG_LEVEL <= level;
56 /** @brief Log function time
58 #define DEBUG_FUNCTION_TIME Situare::Logger function_time_logger(QtDebugMsg, __PRETTY_FUNCTION__)