LSST Applications g063fba187b+66a50001ff,g0f08755f38+1a22dc2551,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g217e2c1bcf+12e87a5bd8,g246886dfd9+466c7b6c06,g28da252d5a+858b171e04,g2bbee38e9b+404b60ec9b,g2bc492864f+404b60ec9b,g3156d2b45e+6e55a43351,g347aa1857d+404b60ec9b,g35bb328faa+a8ce1bb630,g3a166c0a6a+404b60ec9b,g3e281a1b8c+c5dd892a6c,g414038480c+6b9177ef31,g41af890bb2+70bea58702,g599934f4f4+b8c5400ca5,g781aacb6e4+a8ce1bb630,g7af13505b9+b5b9cefdb8,g80478fca09+c2997882f3,g82479be7b0+8974e6af0f,g858d7b2824+1a22dc2551,g89c8672015+f4add4ffd5,g8f1c07a47a+de51c9b0a5,g9125e01d80+a8ce1bb630,ga5288a1d22+b66f8cf76b,gb58c049af0+d64f4d3760,gc28159a63d+404b60ec9b,gcab2d0539d+66cf1de5d4,gcf0d15dbbd+12cb7e2563,gda6a2b7d83+12cb7e2563,gdaeeff99f8+1711a396fd,ge79ae78c31+404b60ec9b,gef2f8181fd+414189b318,gf0baf85859+c1f95f4921,gf0c06eb49c+1a22dc2551,gfa517265be+1a22dc2551,gfa999e8aa5+17cd334064,v28.0.0.rc2
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 | ) |