log4cplus
2.1.0
|
This header defines the logging macros. More...
#include <log4cplus/config.hxx>
#include <log4cplus/streams.h>
#include <log4cplus/logger.h>
#include <log4cplus/helpers/snprintf.h>
#include <log4cplus/tracelogger.h>
#include <sstream>
#include <utility>
Go to the source code of this file.
Namespaces | |
log4cplus | |
log4cplus::detail | |
Macros | |
#define | LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() /* empty */ |
#define | LOG4CPLUS_RESTORE_DOWHILE_WARNING() /* empty */ |
#define | LOG4CPLUS_DOWHILE_NOTHING() |
#define | LOG4CPLUS_MACRO_FUNCTION() nullptr |
#define | LOG4CPLUS_MACRO_FILE() nullptr |
#define | LOG4CPLUS_MACRO_FILE() __FILE__ |
#define | LOG4CPLUS_MACRO_TRACE_LOG_LEVEL(pred) LOG4CPLUS_UNLIKELY (pred) |
#define | LOG4CPLUS_MACRO_DEBUG_LOG_LEVEL(pred) LOG4CPLUS_UNLIKELY (pred) |
#define | LOG4CPLUS_MACRO_INFO_LOG_LEVEL(pred) LOG4CPLUS_LIKELY (pred) |
#define | LOG4CPLUS_MACRO_WARN_LOG_LEVEL(pred) LOG4CPLUS_LIKELY (pred) |
#define | LOG4CPLUS_MACRO_ERROR_LOG_LEVEL(pred) LOG4CPLUS_LIKELY (pred) |
#define | LOG4CPLUS_MACRO_FATAL_LOG_LEVEL(pred) LOG4CPLUS_LIKELY (pred) |
#define | LOG4CPLUS_MACRO_LOGLEVEL_PRED(pred, logLevel) LOG4CPLUS_MACRO_ ## logLevel (pred) |
Dispatch to LOG4CPLUS_MACRO_LOGLEVEL_* depending on log level. More... | |
#define | LOG4CPLUS_MACRO_INSTANTIATE_OSTRINGSTREAM(var) |
#define | LOG4CPLUS_MACRO_INSTANTIATE_SNPRINTF_BUF(var) |
#define | LOG4CPLUS_MACRO_BODY(logger, logEvent, logLevel) |
#define | LOG4CPLUS_MACRO_STR_BODY(logger, logEvent, logLevel) |
#define | LOG4CPLUS_MACRO_FMT_BODY(logger, logLevel, ...) |
#define | LOG4CPLUS_TRACE_METHOD(logger, logEvent) |
#define | LOG4CPLUS_TRACE(logger, logEvent) LOG4CPLUS_MACRO_BODY (logger, logEvent, TRACE_LOG_LEVEL) |
TraceLogger to log a TRACE_LOG_LEVEL message to logger upon entry and exiting of a method. More... | |
#define | LOG4CPLUS_TRACE_STR(logger, logEvent) LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, TRACE_LOG_LEVEL) |
#define | LOG4CPLUS_TRACE_FMT(logger, ...) LOG4CPLUS_MACRO_FMT_BODY (logger, TRACE_LOG_LEVEL, __VA_ARGS__) |
#define | LOG4CPLUS_DEBUG(logger, logEvent) LOG4CPLUS_MACRO_BODY (logger, logEvent, DEBUG_LOG_LEVEL) |
DEBUG_LOG_LEVEL message to logger . More... | |
#define | LOG4CPLUS_DEBUG_STR(logger, logEvent) LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, DEBUG_LOG_LEVEL) |
#define | LOG4CPLUS_DEBUG_FMT(logger, ...) LOG4CPLUS_MACRO_FMT_BODY (logger, DEBUG_LOG_LEVEL, __VA_ARGS__) |
#define | LOG4CPLUS_INFO(logger, logEvent) LOG4CPLUS_MACRO_BODY (logger, logEvent, INFO_LOG_LEVEL) |
INFO_LOG_LEVEL message to logger . More... | |
#define | LOG4CPLUS_INFO_STR(logger, logEvent) LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, INFO_LOG_LEVEL) |
#define | LOG4CPLUS_INFO_FMT(logger, ...) LOG4CPLUS_MACRO_FMT_BODY (logger, INFO_LOG_LEVEL, __VA_ARGS__) |
#define | LOG4CPLUS_WARN(logger, logEvent) LOG4CPLUS_MACRO_BODY (logger, logEvent, WARN_LOG_LEVEL) |
WARN_LOG_LEVEL message to logger . More... | |
#define | LOG4CPLUS_WARN_STR(logger, logEvent) LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, WARN_LOG_LEVEL) |
#define | LOG4CPLUS_WARN_FMT(logger, ...) LOG4CPLUS_MACRO_FMT_BODY (logger, WARN_LOG_LEVEL, __VA_ARGS__) |
#define | LOG4CPLUS_ERROR(logger, logEvent) LOG4CPLUS_MACRO_BODY (logger, logEvent, ERROR_LOG_LEVEL) |
ERROR_LOG_LEVEL message to logger . More... | |
#define | LOG4CPLUS_ERROR_STR(logger, logEvent) LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, ERROR_LOG_LEVEL) |
#define | LOG4CPLUS_ERROR_FMT(logger, ...) LOG4CPLUS_MACRO_FMT_BODY (logger, ERROR_LOG_LEVEL, __VA_ARGS__) |
#define | LOG4CPLUS_FATAL(logger, logEvent) LOG4CPLUS_MACRO_BODY (logger, logEvent, FATAL_LOG_LEVEL) |
FATAL_LOG_LEVEL message to logger . More... | |
#define | LOG4CPLUS_FATAL_STR(logger, logEvent) LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, FATAL_LOG_LEVEL) |
#define | LOG4CPLUS_FATAL_FMT(logger, ...) LOG4CPLUS_MACRO_FMT_BODY (logger, FATAL_LOG_LEVEL, __VA_ARGS__) |
#define | LOG4CPLUS_ASSERT_STRINGIFY(X) #X |
Helper macro for LOG4CPLUS_ASSERT() macro. More... | |
#define | LOG4CPLUS_ASSERT(logger, condition) |
If the condition given in second parameter evaluates false, this macro logs it using FATAL log level, including the condition's source text. More... | |
Functions | |
Logger | log4cplus::detail::macros_get_logger (Logger const &logger) |
Logger const & | log4cplus::detail::macros_get_logger (Logger &logger) |
Logger | log4cplus::detail::macros_get_logger (Logger &&logger) |
Logger | log4cplus::detail::macros_get_logger (tstring const &logger) |
Logger | log4cplus::detail::macros_get_logger (tchar const *logger) |
LOG4CPLUS_EXPORT void | log4cplus::detail::clear_tostringstream (tostringstream &) |
LOG4CPLUS_EXPORT log4cplus::tostringstream & | log4cplus::detail::get_macro_body_oss () |
LOG4CPLUS_EXPORT log4cplus::helpers::snprintf_buf & | log4cplus::detail::get_macro_body_snprintf_buf () |
LOG4CPLUS_EXPORT void | log4cplus::detail::macro_forced_log (log4cplus::Logger const &, log4cplus::LogLevel, log4cplus::tstring const &, char const *, int, char const *) |
LOG4CPLUS_EXPORT void | log4cplus::detail::macro_forced_log (log4cplus::Logger const &, log4cplus::LogLevel, log4cplus::tchar const *, char const *, int, char const *) |
This header defines the logging macros.
Definition in file loggingmacros.h.
#define LOG4CPLUS_ASSERT | ( | logger, | |
condition | |||
) |
If the condition given in second parameter evaluates false, this macro logs it using FATAL log level, including the condition's source text.
Definition at line 394 of file loggingmacros.h.
#define LOG4CPLUS_ASSERT_STRINGIFY | ( | X | ) | #X |
Helper macro for LOG4CPLUS_ASSERT() macro.
Definition at line 389 of file loggingmacros.h.
#define LOG4CPLUS_DEBUG | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_BODY (logger, logEvent, DEBUG_LOG_LEVEL) |
DEBUG_LOG_LEVEL message to logger
.
logEvent
will be streamed into an ostream
.
Definition at line 294 of file loggingmacros.h.
#define LOG4CPLUS_DEBUG_FMT | ( | logger, | |
... | |||
) | LOG4CPLUS_MACRO_FMT_BODY (logger, DEBUG_LOG_LEVEL, __VA_ARGS__) |
Definition at line 298 of file loggingmacros.h.
#define LOG4CPLUS_DEBUG_STR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, DEBUG_LOG_LEVEL) |
Definition at line 296 of file loggingmacros.h.
#define LOG4CPLUS_DOWHILE_NOTHING | ( | ) |
Definition at line 56 of file loggingmacros.h.
#define LOG4CPLUS_ERROR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_BODY (logger, logEvent, ERROR_LOG_LEVEL) |
ERROR_LOG_LEVEL message to logger
.
logEvent
will be streamed into an ostream
.
Definition at line 354 of file loggingmacros.h.
#define LOG4CPLUS_ERROR_FMT | ( | logger, | |
... | |||
) | LOG4CPLUS_MACRO_FMT_BODY (logger, ERROR_LOG_LEVEL, __VA_ARGS__) |
Definition at line 358 of file loggingmacros.h.
#define LOG4CPLUS_ERROR_STR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, ERROR_LOG_LEVEL) |
Definition at line 356 of file loggingmacros.h.
#define LOG4CPLUS_FATAL | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_BODY (logger, logEvent, FATAL_LOG_LEVEL) |
FATAL_LOG_LEVEL message to logger
.
logEvent
will be streamed into an ostream
.
Definition at line 374 of file loggingmacros.h.
#define LOG4CPLUS_FATAL_FMT | ( | logger, | |
... | |||
) | LOG4CPLUS_MACRO_FMT_BODY (logger, FATAL_LOG_LEVEL, __VA_ARGS__) |
Definition at line 378 of file loggingmacros.h.
#define LOG4CPLUS_FATAL_STR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, FATAL_LOG_LEVEL) |
Definition at line 376 of file loggingmacros.h.
#define LOG4CPLUS_INFO | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_BODY (logger, logEvent, INFO_LOG_LEVEL) |
INFO_LOG_LEVEL message to logger
.
logEvent
will be streamed into an ostream
.
Definition at line 314 of file loggingmacros.h.
#define LOG4CPLUS_INFO_FMT | ( | logger, | |
... | |||
) | LOG4CPLUS_MACRO_FMT_BODY (logger, INFO_LOG_LEVEL, __VA_ARGS__) |
Definition at line 318 of file loggingmacros.h.
#define LOG4CPLUS_INFO_STR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, INFO_LOG_LEVEL) |
Definition at line 316 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_BODY | ( | logger, | |
logEvent, | |||
logLevel | |||
) |
Definition at line 211 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_DEBUG_LOG_LEVEL | ( | pred | ) | LOG4CPLUS_UNLIKELY (pred) |
Definition at line 173 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_ERROR_LOG_LEVEL | ( | pred | ) | LOG4CPLUS_LIKELY (pred) |
Definition at line 179 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_FATAL_LOG_LEVEL | ( | pred | ) | LOG4CPLUS_LIKELY (pred) |
Definition at line 181 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_FILE | ( | ) | nullptr |
Definition at line 165 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_FILE | ( | ) | __FILE__ |
Definition at line 165 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_FMT_BODY | ( | logger, | |
logLevel, | |||
... | |||
) |
Definition at line 244 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_FUNCTION | ( | ) | nullptr |
Definition at line 144 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_INFO_LOG_LEVEL | ( | pred | ) | LOG4CPLUS_LIKELY (pred) |
Definition at line 175 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_INSTANTIATE_OSTRINGSTREAM | ( | var | ) |
Definition at line 200 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_INSTANTIATE_SNPRINTF_BUF | ( | var | ) |
Definition at line 204 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_LOGLEVEL_PRED | ( | pred, | |
logLevel | |||
) | LOG4CPLUS_MACRO_ ## logLevel (pred) |
Dispatch to LOG4CPLUS_MACRO_LOGLEVEL_* depending on log level.
Definition at line 186 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_STR_BODY | ( | logger, | |
logEvent, | |||
logLevel | |||
) |
Definition at line 229 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_TRACE_LOG_LEVEL | ( | pred | ) | LOG4CPLUS_UNLIKELY (pred) |
Definition at line 171 of file loggingmacros.h.
#define LOG4CPLUS_MACRO_WARN_LOG_LEVEL | ( | pred | ) | LOG4CPLUS_LIKELY (pred) |
Definition at line 177 of file loggingmacros.h.
#define LOG4CPLUS_RESTORE_DOWHILE_WARNING | ( | ) | /* empty */ |
Definition at line 52 of file loggingmacros.h.
#define LOG4CPLUS_SUPPRESS_DOWHILE_WARNING | ( | ) | /* empty */ |
Definition at line 51 of file loggingmacros.h.
#define LOG4CPLUS_TRACE | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_BODY (logger, logEvent, TRACE_LOG_LEVEL) |
TraceLogger to log a TRACE_LOG_LEVEL message to logger
upon entry and exiting of a method.
logEvent
will be streamed into an ostream
.
Definition at line 273 of file loggingmacros.h.
#define LOG4CPLUS_TRACE_FMT | ( | logger, | |
... | |||
) | LOG4CPLUS_MACRO_FMT_BODY (logger, TRACE_LOG_LEVEL, __VA_ARGS__) |
Definition at line 277 of file loggingmacros.h.
#define LOG4CPLUS_TRACE_METHOD | ( | logger, | |
logEvent | |||
) |
Definition at line 269 of file loggingmacros.h.
#define LOG4CPLUS_TRACE_STR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, TRACE_LOG_LEVEL) |
Definition at line 275 of file loggingmacros.h.
#define LOG4CPLUS_WARN | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_BODY (logger, logEvent, WARN_LOG_LEVEL) |
WARN_LOG_LEVEL message to logger
.
logEvent
will be streamed into an ostream
.
Definition at line 334 of file loggingmacros.h.
#define LOG4CPLUS_WARN_FMT | ( | logger, | |
... | |||
) | LOG4CPLUS_MACRO_FMT_BODY (logger, WARN_LOG_LEVEL, __VA_ARGS__) |
Definition at line 338 of file loggingmacros.h.
#define LOG4CPLUS_WARN_STR | ( | logger, | |
logEvent | |||
) | LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, WARN_LOG_LEVEL) |
Definition at line 336 of file loggingmacros.h.