LSST Applications g063fba187b+fee0456c91,g0f08755f38+ea96e5a5a3,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+90257ff92a,g20f6ffc8e0+ea96e5a5a3,g217e2c1bcf+937a289c59,g28da252d5a+daa7da44eb,g2bbee38e9b+253935c60e,g2bc492864f+253935c60e,g3156d2b45e+6e55a43351,g32e5bea42b+31359a2a7a,g347aa1857d+253935c60e,g35bb328faa+a8ce1bb630,g3a166c0a6a+253935c60e,g3b1af351f3+a8ce1bb630,g3e281a1b8c+c5dd892a6c,g414038480c+416496e02f,g41af890bb2+afe91b1188,g599934f4f4+0db33f7991,g7af13505b9+e36de7bce6,g80478fca09+da231ba887,g82479be7b0+a4516e59e3,g858d7b2824+ea96e5a5a3,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+bc6ab8dfbd,gb58c049af0+d64f4d3760,gc28159a63d+253935c60e,gcab2d0539d+3f2b72788c,gcf0d15dbbd+4ea9c45075,gda6a2b7d83+4ea9c45075,gdaeeff99f8+1711a396fd,ge79ae78c31+253935c60e,gef2f8181fd+3031e3cf99,gf0baf85859+c1f95f4921,gfa517265be+ea96e5a5a3,gfa999e8aa5+17cd334064,w.2024.50
LSST Data Management Base Package
|
LSST DM logging module built on log4cxx. More...
#include <functional>
#include <sstream>
#include <stdarg.h>
#include <string>
#include <log4cxx/logger.h>
#include <boost/format.hpp>
Go to the source code of this file.
Classes | |
class | lsst::log::Log |
This static class includes a variety of methods for interacting with the the logging module. More... | |
class | lsst::log::LogMDCScope |
Namespaces | |
namespace | lsst |
namespace | lsst::log |
Macros | |
#define | LOG_CONFIG(filename) lsst::log::Log::configure(filename) |
Configures log4cxx and initializes logging module. | |
#define | LOG_CONFIG_PROP(string) lsst::log::Log::configure_prop(string) |
Configures log4cxx from a string containing list of properties. | |
#define | LOG_GET(logger) lsst::log::Log::getLogger(logger) |
Returns a Log object associated with logger. | |
#define | LOG_GET_CHILD(logger, suffix) lsst::log::Log::getLogger(logger).getChild(suffix) |
Returns a Log object associated with descendant of a logger. | |
#define | LOG_MDC(key, value) lsst::log::Log::MDC(key, value) |
Places a KEY/VALUE pair in the Mapped Diagnostic Context (MDC) for the current thread. | |
#define | LOG_MDC_REMOVE(key) lsst::log::Log::MDCRemove(key) |
Remove the value associated with KEY within the MDC. | |
#define | LOG_CONCAT_IMPL(a, b) a ## b |
#define | LOG_CONCAT_IMPL2(a, b) LOG_CONCAT_IMPL(a, b) |
#define | LOG_MDC_SCOPE(key, value) lsst::log::LogMDCScope LOG_CONCAT_IMPL2(_log_mdc_scope_, __COUNTER__)(key, value); |
Places a KEY/VALUE pair in the Mapped Diagnostic Context (MDC) for the current thread, and restores previous KEY/VALUE on exit from a scope. | |
#define | LOG_MDC_INIT(func) lsst::log::Log::MDCRegisterInit(std::function<void()>(func)) |
Register function for initialization of MDC. | |
#define | LOG_SET_LVL(logger, level) lsst::log::Log::getLogger(logger).setLevel(level) |
Set the logging threshold for LOGGER to LEVEL. | |
#define | LOG_GET_LVL(logger) lsst::log::Log::getLogger(logger).getLevel() |
Retrieve the logging threshold for LOGGER. | |
#define | LOG_GETEFF_LVL(logger) lsst::log::Log::getLogger(logger).getEffectiveLevel() |
Retrieve the effective logging threshold for LOGGER. | |
#define | LOG_CHECK_LVL(logger, level) lsst::log::Log::getLogger(logger).isEnabledFor(level) |
Return whether the logging threshold of LOGGER is less than or equal to LEVEL. | |
#define | LOG_CHECK_TRACE() LOG4CXX_UNLIKELY(lsst::log::Log::getDefaultLogger().isTraceEnabled()) |
Return whether the logging threshold of the default logger is less than or equal to TRACE. | |
#define | LOG_CHECK_DEBUG() LOG4CXX_UNLIKELY(lsst::log::Log::getDefaultLogger().isDebugEnabled()) |
Return whether the logging threshold of the default logger is less than or equal to DEBUG. | |
#define | LOG_CHECK_INFO() lsst::log::Log::getDefaultLogger().isInfoEnabled() |
Return whether the logging threshold of the default logger is less than or equal to INFO. | |
#define | LOG_CHECK_WARN() lsst::log::Log::getDefaultLogger().isWarnEnabled() |
Return whether the logging threshold of the default logger is less than or equal to WARN. | |
#define | LOG_CHECK_ERROR() lsst::log::Log::getDefaultLogger().isErrorEnabled() |
Return whether the logging threshold of the default logger is less than or equal to ERROR. | |
#define | LOG_CHECK_FATAL() lsst::log::Log::getDefaultLogger().isFatalEnabled() |
Return whether the logging threshold of the default logger is less than or equal to FATAL. | |
#define | LOG(logger, level, message...) |
Log a message using a varargs/printf style interface. | |
#define | LOG_TRACE(message...) |
Log a trace-level message to the default logger using a varargs/printf style interface. | |
#define | LOG_DEBUG(message...) |
Log a debug-level message to the default logger using a varargs/printf style interface. | |
#define | LOG_INFO(message...) |
Log a info-level message to the default logger using a varargs/printf style interface. | |
#define | LOG_WARN(message...) |
Log a warn-level message to the default logger using a varargs/printf style interface. | |
#define | LOG_ERROR(message...) |
Log a error-level message to the default logger using a varargs/printf style interface. | |
#define | LOG_FATAL(message...) |
Log a fatal-level message to the default logger using a varargs/printf style interface. | |
#define | LOG_MESSAGE_VIA_STREAM_(logger, level, message) |
#define | LOGS(logger, level, message) |
Log a message using an iostream-based interface. | |
#define | LOGS_TRACE(message) |
Log a trace-level message to the default logger using an iostream-based interface. | |
#define | LOGS_DEBUG(message) |
Log a debug-level message to the default logger using an iostream-based interface. | |
#define | LOGS_INFO(message) |
Log a info-level message to the default logger using an iostream-based interface. | |
#define | LOGS_WARN(message) |
Log a warning-level message to the default logger using an iostream-based interface. | |
#define | LOGS_ERROR(message) |
Log a error-level message to the default logger using an iostream-based interface. | |
#define | LOGS_FATAL(message) |
Log a fatal-level message to the default logger using an iostream-based interface. | |
#define | LOGL_TRACE(logger, message...) |
Log a trace-level message using a varargs/printf style interface. | |
#define | LOGL_DEBUG(logger, message...) |
Log a debug-level message using a varargs/printf style interface. | |
#define | LOGL_INFO(logger, message...) |
Log a info-level message using a varargs/printf style interface. | |
#define | LOGL_WARN(logger, message...) |
Log a warn-level message using a varargs/printf style interface. | |
#define | LOGL_ERROR(logger, message...) |
Log a error-level message using a varargs/printf style interface. | |
#define | LOGL_FATAL(logger, message...) |
Log a fatal-level message using a varargs/printf style interface. | |
#define | LOGLS_TRACE(logger, message) |
Log a trace-level message using an iostream-based interface. | |
#define | LOGLS_DEBUG(logger, message) |
Log a debug-level message using an iostream-based interface. | |
#define | LOGLS_INFO(logger, message) |
Log a info-level message using an iostream-based interface. | |
#define | LOGLS_WARN(logger, message) |
Log a warn-level message using an iostream-based interface. | |
#define | LOGLS_ERROR(logger, message) |
Log a error-level message using an iostream-based interface. | |
#define | LOGLS_FATAL(logger, message) |
Log a fatal-level message using an iostream-based interface. | |
#define | LOG_LVL_TRACE static_cast<int>(log4cxx::Level::TRACE_INT) |
#define | LOG_LVL_DEBUG static_cast<int>(log4cxx::Level::DEBUG_INT) |
#define | LOG_LVL_INFO static_cast<int>(log4cxx::Level::INFO_INT) |
#define | LOG_LVL_WARN static_cast<int>(log4cxx::Level::WARN_INT) |
#define | LOG_LVL_ERROR static_cast<int>(log4cxx::Level::ERROR_INT) |
#define | LOG_LVL_FATAL static_cast<int>(log4cxx::Level::FATAL_INT) |
#define | LOG_LOGGER lsst::log::Log |
Functions | |
unsigned | lsst::log::lwpID () |
Function which returns LWP ID on platforms which support it. | |
LSST DM logging module built on log4cxx.
Definition in file Log.h.
#define LOG | ( | logger, | |
level, | |||
message... ) |
Log a message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
level | Logging level associated with message. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 251 of file Log.h.
#define LOG_CHECK_DEBUG | ( | ) | LOG4CXX_UNLIKELY(lsst::log::Log::getDefaultLogger().isDebugEnabled()) |
#define LOG_CHECK_ERROR | ( | ) | lsst::log::Log::getDefaultLogger().isErrorEnabled() |
#define LOG_CHECK_FATAL | ( | ) | lsst::log::Log::getDefaultLogger().isFatalEnabled() |
#define LOG_CHECK_INFO | ( | ) | lsst::log::Log::getDefaultLogger().isInfoEnabled() |
#define LOG_CHECK_LVL | ( | logger, | |
level ) lsst::log::Log::getLogger(logger).isEnabledFor(level) |
Return whether the logging threshold of LOGGER is less than or equal to LEVEL.
logger | Either a logger name or a Log object being queried. |
level | Logging threshold to check. |
Definition at line 185 of file Log.h.
#define LOG_CHECK_TRACE | ( | ) | LOG4CXX_UNLIKELY(lsst::log::Log::getDefaultLogger().isTraceEnabled()) |
#define LOG_CHECK_WARN | ( | ) | lsst::log::Log::getDefaultLogger().isWarnEnabled() |
#define LOG_CONFIG | ( | filename | ) | lsst::log::Log::configure(filename) |
#define LOG_CONFIG_PROP | ( | string | ) | lsst::log::Log::configure_prop(string) |
Configures log4cxx from a string containing list of properties.
This is equivalent to configuring with a file name containing the same data as a string.
string | List of properties (lines separated by new line character) |
#define LOG_DEBUG | ( | message... | ) |
Log a debug-level message to the default logger using a varargs/printf style interface.
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 281 of file Log.h.
#define LOG_ERROR | ( | message... | ) |
Log a error-level message to the default logger using a varargs/printf style interface.
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 326 of file Log.h.
#define LOG_FATAL | ( | message... | ) |
Log a fatal-level message to the default logger using a varargs/printf style interface.
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 341 of file Log.h.
#define LOG_GET | ( | logger | ) | lsst::log::Log::getLogger(logger) |
#define LOG_GET_CHILD | ( | logger, | |
suffix ) lsst::log::Log::getLogger(logger).getChild(suffix) |
#define LOG_GET_LVL | ( | logger | ) | lsst::log::Log::getLogger(logger).getLevel() |
#define LOG_GETEFF_LVL | ( | logger | ) | lsst::log::Log::getLogger(logger).getEffectiveLevel() |
Retrieve the effective logging threshold for LOGGER.
logger | Either a logger name or a Log object with threshold to return. |
Definition at line 173 of file Log.h.
#define LOG_INFO | ( | message... | ) |
Log a info-level message to the default logger using a varargs/printf style interface.
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 296 of file Log.h.
#define LOG_LOGGER lsst::log::Log |
#define LOG_LVL_DEBUG static_cast<int>(log4cxx::Level::DEBUG_INT) |
#define LOG_LVL_ERROR static_cast<int>(log4cxx::Level::ERROR_INT) |
#define LOG_LVL_FATAL static_cast<int>(log4cxx::Level::FATAL_INT) |
#define LOG_LVL_INFO static_cast<int>(log4cxx::Level::INFO_INT) |
#define LOG_LVL_TRACE static_cast<int>(log4cxx::Level::TRACE_INT) |
#define LOG_LVL_WARN static_cast<int>(log4cxx::Level::WARN_INT) |
#define LOG_MDC | ( | key, | |
value ) lsst::log::Log::MDC(key, value) |
Places a KEY/VALUE pair in the Mapped Diagnostic Context (MDC) for the current thread.
The VALUE may then be included in log messages by using the following the X
conversion character within a pattern layout as X{KEY}
.
key | Unique key. |
value | String value. |
#define LOG_MDC_INIT | ( | func | ) | lsst::log::Log::MDCRegisterInit(std::function<void()>(func)) |
Register function for initialization of MDC.
This function will be called for current thread and every new thread (but not for other existing threads) before any message is logged using one of the macros below. Its main purpose is to initialize MDC (using LOG_MDC macro). In some cases the function may be called more than once per thread.
This macro is thread safe, but typically it will be called from main thread before any other LOG macro.
Macro returns an integer number, the value is not specified, but this allows it to be used in one-time initialization constructs like:
@code static int dummyMdcInit = LOG_MDC_INIT(some_init_func); @endcode
func | Any function object which takes no arguments and returns void. |
#define LOG_MDC_REMOVE | ( | key | ) | lsst::log::Log::MDCRemove(key) |
#define LOG_MDC_SCOPE | ( | key, | |
value ) lsst::log::LogMDCScope LOG_CONCAT_IMPL2(_log_mdc_scope_, __COUNTER__)(key, value); |
#define LOG_MESSAGE_VIA_STREAM_ | ( | logger, | |
level, | |||
message ) |
Definition at line 350 of file Log.h.
#define LOG_SET_LVL | ( | logger, | |
level ) lsst::log::Log::getLogger(logger).setLevel(level) |
#define LOG_TRACE | ( | message... | ) |
Log a trace-level message to the default logger using a varargs/printf style interface.
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 266 of file Log.h.
#define LOG_WARN | ( | message... | ) |
Log a warn-level message to the default logger using a varargs/printf style interface.
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 311 of file Log.h.
#define LOGL_DEBUG | ( | logger, | |
message... ) |
Log a debug-level message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 515 of file Log.h.
#define LOGL_ERROR | ( | logger, | |
message... ) |
Log a error-level message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 563 of file Log.h.
#define LOGL_FATAL | ( | logger, | |
message... ) |
Log a fatal-level message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 579 of file Log.h.
#define LOGL_INFO | ( | logger, | |
message... ) |
Log a info-level message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 531 of file Log.h.
#define LOGL_TRACE | ( | logger, | |
message... ) |
Log a trace-level message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 499 of file Log.h.
#define LOGL_WARN | ( | logger, | |
message... ) |
Log a warn-level message using a varargs/printf style interface.
logger | Either a logger name or a Log object. |
message | An sprintf-compatible format string followed by zero, one, or more comma-separated arguments. |
Definition at line 547 of file Log.h.
#define LOGLS_DEBUG | ( | logger, | |
message ) |
Log a debug-level message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGLS_DEBUG(logger, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
message | Message to be logged. |
Definition at line 619 of file Log.h.
#define LOGLS_ERROR | ( | logger, | |
message ) |
Log a error-level message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGLS_ERROR(logger, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
message | Message to be logged. |
Definition at line 679 of file Log.h.
#define LOGLS_FATAL | ( | logger, | |
message ) |
Log a fatal-level message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGLS_FATAL(logger, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
message | Message to be logged. |
Definition at line 699 of file Log.h.
#define LOGLS_INFO | ( | logger, | |
message ) |
Log a info-level message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGLS_INFO(logger, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
message | Message to be logged. |
Definition at line 639 of file Log.h.
#define LOGLS_TRACE | ( | logger, | |
message ) |
Log a trace-level message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGLS_TRACE(logger, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
message | Message to be logged. |
Definition at line 599 of file Log.h.
#define LOGLS_WARN | ( | logger, | |
message ) |
Log a warn-level message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGLS_WARN(logger, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
message | Message to be logged. |
Definition at line 659 of file Log.h.
#define LOGS | ( | logger, | |
level, | |||
message ) |
Log a message using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS("logger", LOG_LVL_DEBUG, "coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
logger | Either a logger name or a Log object. |
level | Logging level associated with message. |
message | Message to be logged. |
Definition at line 369 of file Log.h.
#define LOGS_DEBUG | ( | message | ) |
Log a debug-level message to the default logger using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS_DEBUG("coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
message | Message to be logged. |
Definition at line 407 of file Log.h.
#define LOGS_ERROR | ( | message | ) |
Log a error-level message to the default logger using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS_ERROR("coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
message | Message to be logged. |
Definition at line 464 of file Log.h.
#define LOGS_FATAL | ( | message | ) |
Log a fatal-level message to the default logger using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS_FATAL("coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
message | Message to be logged. |
Definition at line 483 of file Log.h.
#define LOGS_INFO | ( | message | ) |
Log a info-level message to the default logger using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS_INFO("coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
message | Message to be logged. |
Definition at line 426 of file Log.h.
#define LOGS_TRACE | ( | message | ) |
Log a trace-level message to the default logger using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS_TRACE("coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
message | Message to be logged. |
Definition at line 388 of file Log.h.
#define LOGS_WARN | ( | message | ) |
Log a warning-level message to the default logger using an iostream-based interface.
Message is any expression which can appear on the right side of the stream insertion operator, e.g. LOGS_WARN("coordinates: x=" << x << " y=" << y);
. Usual caveat regarding commas inside macro arguments applies to message argument.
message | Message to be logged. |
Definition at line 445 of file Log.h.