39 #define SVH_LOG_DEBUG_STREAM(NAME, M) \ 42 std::stringstream ss; \ 44 Logger::log(__FILE__, __LINE__, NAME, driver_svh::LogLevel::DEBUG, ss.str()); \ 46 #define SVH_LOG_INFO_STREAM(NAME, M) \ 49 std::stringstream ss; \ 51 Logger::log(__FILE__, __LINE__, NAME, driver_svh::LogLevel::INFO, ss.str()); \ 53 #define SVH_LOG_WARN_STREAM(NAME, M) \ 56 std::stringstream ss; \ 58 Logger::log(__FILE__, __LINE__, NAME, driver_svh::LogLevel::WARN, ss.str()); \ 60 #define SVH_LOG_ERROR_STREAM(NAME, M) \ 63 std::stringstream ss; \ 65 Logger::log(__FILE__, __LINE__, NAME, driver_svh::LogLevel::ERROR, ss.str()); \ 67 #define SVH_LOG_FATAL_STREAM(NAME, M) \ 70 std::stringstream ss; \ 72 Logger::log(__FILE__, __LINE__, NAME, driver_svh::LogLevel::FATAL, ss.str()); \ 104 static void log(
const std::string& file,
106 const std::string& name,
108 const std::string& msg...)
static void log(const std::string &file, const int line, const std::string &name, const LogLevel level, const std::string &msg...)
static void setLogLevel(const LogLevel &log_level)
Small singleton-based logging class with an exchangeable log handler.
static void setLogHandler(std::unique_ptr< LogHandler > log_handler)
static Logger & getInstance()
virtual ~Logger()=default
void operator=(Logger const &)=delete
std::unique_ptr< LogHandler > m_log_handler