LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
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. | |
bool | isErrorEnabled () const |
Check whether the logger is enabled for the ERROR Level. | |
bool | isFatalEnabled () const |
Check whether the logger is enabled for the FATAL Level. | |
bool | isInfoEnabled () const |
Check whether the logger is enabled for the INFO Level. | |
bool | isTraceEnabled () const |
Check whether the logger is enabled for the TRACE Level. | |
bool | isWarnEnabled () const |
Check whether the logger is enabled for the WARN Level. | |
std::string | getName () const |
Get the logger name associated with the Log object. | |
void | setLevel (int level) |
Set the logging threshold to LEVEL. | |
int | getLevel () const |
Retrieve the logging threshold. | |
int | getEffectiveLevel () const |
Retrieve the effective logging threshold. | |
bool | isEnabledFor (int level) const |
Return whether the logging threshold of the logger is less than or equal to LEVEL. | |
Log | getChild (std::string const &suffix) const |
Return a logger which is a descendant to this logger. | |
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. | |
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. | |
Static Public Member Functions | |
static Log | getDefaultLogger () |
Return default logger instance, same as default constructor. | |
static void | configure () |
Explicitly configures log4cxx and initializes logging system. | |
static void | configure (std::string const &filename) |
Configures log4cxx from specified file. | |
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. | |
static Log | getLogger (Log const &logger) |
static Log | getLogger (std::string const &loggername) |
Returns logger object for a given name. | |
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. | |
static void | MDCRemove (std::string const &key) |
Remove the value associated with KEY within the MDC. | |
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 |
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.
properties | Configuration properties. |
Definition at line 220 of file Log.cc.
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 |
Get the logger name associated with the Log object.
Definition at line 240 of file Log.cc.
|
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. |
Definition at line 345 of file Log.cc.
|
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 ) |
Method used by LOGS_INFO and similar macros to process a log message.
level | message level |
location | message origin location |
msg | message string |
Definition at line 400 of file Log.cc.
|
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 |
Definition at line 292 of file Log.cc.
|
static |
void lsst::log::Log::setLevel | ( | int | level | ) |