25 virtual ~LoggerImpl() {};
26 virtual void vlog(LogLevel level, const std::string fmt, va_list args) = 0;
27 virtual void log(LogLevel level, const std::string& msg) = 0;
33 const std::shared_ptr<LoggerImpl> &logger;
34 const std::string func;
37 FuncLogger(const std::shared_ptr<LoggerImpl> &logger, const std::string &func) : logger(logger), func(func)
39 logger->log(LOG_DEBUG, "> " + func);
44 logger->log(LOG_DEBUG, "< " + func);
51 static std::shared_ptr<LoggerImpl> logger;
55 static void setLogging(LogType type, LogLevel level = LOG_INFO);
56 static void log(const std::string fmt, ...);
57 static FuncLogger getFuncLogger(const std::string &func);
61 #define __CROSS_FUNCTION__ __FUNCSIG__
63 #define __CROSS_FUNCTION__ __PRETTY_FUNCTION__
66 #define LogFuncEntry() \
67 FuncLogger __funcLogger__ = Logger::getFuncLogger(std::string(__CROSS_FUNCTION__));