23 void log(
LogLevel level,
const std::string& channel,
const std::stringstream& ss,
const RecordInfo& info);
28 #define __func__ __FUNCTION__
32 #define __CARL_LOG_RECORD ::carl::logging::RecordInfo{__FILE__, __func__, __LINE__}
34 #define __CARL_LOG_RECORD_NOFUNC ::carl::logging::RecordInfo{__FILE__, "", __LINE__}
36 #define __CARL_LOG(level, channel, expr) { \
37 if (::carl::logging::visible(level, channel)) { \
38 std::stringstream __ss; __ss << expr; ::carl::logging::log(level, channel, __ss, __CARL_LOG_RECORD); \
42 #define __CARL_LOG_NOFUNC(level, channel, expr) { \
43 if (::carl::logging::visible(level, channel)) { \
44 std::stringstream __ss; __ss << expr; ::carl::logging::log(level, channel, __ss, __CARL_LOG_RECORD_NOFUNC); \
48 #define __CARL_LOG_FUNC(channel, args) __CARL_LOG_NOFUNC(::carl::logging::LogLevel::LVL_TRACE, channel, __func__ << "(" << args << ")");
51 #define __CARL_LOG_TRACE(channel, expr) __CARL_LOG(::carl::logging::LogLevel::LVL_TRACE, channel, expr)
53 #define __CARL_LOG_DEBUG(channel, expr) __CARL_LOG(::carl::logging::LogLevel::LVL_DEBUG, channel, expr)
55 #define __CARL_LOG_INFO(channel, expr) __CARL_LOG(::carl::logging::LogLevel::LVL_INFO, channel, expr)
57 #define __CARL_LOG_WARN(channel, expr) __CARL_LOG(::carl::logging::LogLevel::LVL_WARN, channel, expr)
59 #define __CARL_LOG_ERROR(channel, expr) __CARL_LOG(::carl::logging::LogLevel::LVL_ERROR, channel, expr)
61 #define __CARL_LOG_FATAL(channel, expr) __CARL_LOG(::carl::logging::LogLevel::LVL_FATAL, channel, expr)
64 #define __CARL_LOG_ASSERT(channel, condition, expr) if (!(condition)) { __CARL_LOG_FATAL(channel, expr); assert(condition); }
Contains a custom logging facility.
LogLevel
Indicated which log messages should be forwarded to some sink.
void log(LogLevel level, const std::string &channel, const std::stringstream &ss, const RecordInfo &info)
bool visible(LogLevel level, const std::string &channel) noexcept
Additional information about a log message.
std::string filename
File name.
std::string func
Function name.
std::size_t line
Line number.