LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
This static class includes a variety of methods for interacting with the the logging module. More...
#include <Log.h>
Public Member Functions | |
Log () | |
bool | isDebugEnabled () const |
Check whether the logger is enabled for the DEBUG Level. More... | |
bool | isErrorEnabled () const |
Check whether the logger is enabled for the ERROR Level. More... | |
bool | isFatalEnabled () const |
Check whether the logger is enabled for the FATAL Level. More... | |
bool | isInfoEnabled () const |
Check whether the logger is enabled for the INFO Level. More... | |
bool | isTraceEnabled () const |
Check whether the logger is enabled for the TRACE Level. More... | |
bool | isWarnEnabled () const |
Check whether the logger is enabled for the WARN Level. More... | |
std::string | getName () const |
Get the logger name associated with the Log object. More... | |
void | setLevel (int level) |
Set the logging threshold to LEVEL. More... | |
int | getLevel () const |
Retrieve the logging threshold. More... | |
int | getEffectiveLevel () const |
Retrieve the effective logging threshold. More... | |
bool | isEnabledFor (int level) const |
Return whether the logging threshold of the logger is less than or equal to LEVEL. More... | |
Log | getChild (std::string const &suffix) const |
Return a logger which is a descendant to this logger. More... | |
void | log (log4cxx::LevelPtr level, log4cxx::spi::LocationInfo const &location, char const *fmt,...) |
Method used by LOG_INFO and similar macros to process a log message with variable arguments along with associated metadata. More... | |
void | logMsg (log4cxx::LevelPtr level, log4cxx::spi::LocationInfo const &location, std::string const &msg) |
Method used by LOGS_INFO and similar macros to process a log message. More... | |
Static Public Member Functions | |
static Log | getDefaultLogger () |
Return default logger instance, same as default constructor. More... | |
static void | configure () |
Explicitly configures log4cxx and initializes logging system. More... | |
static void | configure (std::string const &filename) |
Configures log4cxx from specified file. More... | |
static void | configure_prop (std::string const &properties) |
Configures log4cxx using a string containing the list of properties, equivalent to configuring from a file containing the same content but without creating temporary files. More... | |
static Log | getLogger (Log const &logger) |
static Log | getLogger (std::string const &loggername) |
Returns logger object for a given name. More... | |
static std::string | MDC (std::string const &key, std::string const &value) |
Places a KEY/VALUE pair in the Mapped Diagnostic Context (MDC) for the current thread. More... | |
static void | MDCRemove (std::string const &key) |
Remove the value associated with KEY within the MDC. More... | |
static int | MDCRegisterInit (std::function< void()> function) |
This static class includes a variety of methods for interacting with the the logging module.
These methods are not meant for direct use. Rather, they are used by the LOG* macros and the SWIG interface declared in logInterface.h.
|
inline |
|
static |
Explicitly configures log4cxx and initializes logging system.
Configuration can be specified via environment variable LSST_LOG_CONFIG, if it is set and specifies existing file name then this file name is used for configuration. Otherwise pre-defined configuration is used, which is hardwired to add to the root logger a ConsoleAppender. In this case, the output will be formatted using a PatternLayout set to the pattern "%c %p: %m%n".
Definition at line 177 of file Log.cc.
|
static |
Configures log4cxx from specified file.
If file name ends with ".xml", it is passed to log4cxx::xml::DOMConfigurator::configure(). Otherwise, it assumed to be a log4j Java properties file and is passed to log4cxx::PropertyConfigurator::configure(). See http://logging.apache.org/log4cxx/usage.html for additional details.
filename | Path to configuration file. |
Definition at line 201 of file Log.cc.
|
static |
Log lsst::log::Log::getChild | ( | std::string const & | suffix | ) | const |
Return a logger which is a descendant to this logger.
If for example name of this logger is "main.task" and suffix is "subtask1.algorithm" then this method will return logger with the name "main.task.subtask1.algorithm". If this logger is root logger then suffix name is used for returned logger name. If suffix is empty then this instance is returned.
suffix | Suffix for tha name of returned logger, can include dot (but not at leading position) and can be empty. |
Definition at line 366 of file Log.cc.
|
inlinestatic |
int lsst::log::Log::getEffectiveLevel | ( | ) | const |
Retrieve the effective logging threshold.
int lsst::log::Log::getLevel | ( | ) | const |
|
static |
Returns logger object for a given name.
If name is empty then current logger is returned and not a root logger.
loggername | Name of logger to return. |
Definition at line 256 of file Log.cc.
std::string lsst::log::Log::getName | ( | ) | const |
|
inline |
bool lsst::log::Log::isEnabledFor | ( | int | level | ) | const |
Return whether the logging threshold of the logger is less than or equal to LEVEL.
level | Logging threshold to check. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void lsst::log::Log::log | ( | log4cxx::LevelPtr | level, |
log4cxx::spi::LocationInfo const & | location, | ||
char const * | fmt, | ||
... | |||
) |
Method used by LOG_INFO and similar macros to process a log message with variable arguments along with associated metadata.
level | message level |
location | message origin location |
fmt | message format string |
... | message arguments |
Definition at line 386 of file Log.cc.
void lsst::log::Log::logMsg | ( | log4cxx::LevelPtr | level, |
log4cxx::spi::LocationInfo const & | location, | ||
std::string const & | msg | ||
) |
|
static |
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}
. Note that unlike log4cxx::MDC::put()
this method overwrites any previously existing mapping.
key | Unique key. |
value | String value. |
Definition at line 274 of file Log.cc.
|
static |
|
static |
void lsst::log::Log::setLevel | ( | int | level | ) |