LSST Applications g070148d5b3+33e5256705,g0d53e28543+25c8b88941,g0da5cf3356+2dd1178308,g1081da9e2a+62d12e78cb,g17e5ecfddb+7e422d6136,g1c76d35bf8+ede3a706f7,g295839609d+225697d880,g2e2c1a68ba+cc1f6f037e,g2ffcdf413f+853cd4dcde,g38293774b4+62d12e78cb,g3b44f30a73+d953f1ac34,g48ccf36440+885b902d19,g4b2f1765b6+7dedbde6d2,g5320a0a9f6+0c5d6105b6,g56b687f8c9+ede3a706f7,g5c4744a4d9+ef6ac23297,g5ffd174ac0+0c5d6105b6,g6075d09f38+66af417445,g667d525e37+2ced63db88,g670421136f+2ced63db88,g71f27ac40c+2ced63db88,g774830318a+463cbe8d1f,g7876bc68e5+1d137996f1,g7985c39107+62d12e78cb,g7fdac2220c+0fd8241c05,g96f01af41f+368e6903a7,g9ca82378b8+2ced63db88,g9d27549199+ef6ac23297,gabe93b2c52+e3573e3735,gb065e2a02a+3dfbe639da,gbc3249ced9+0c5d6105b6,gbec6a3398f+0c5d6105b6,gc9534b9d65+35b9f25267,gd01420fc67+0c5d6105b6,geee7ff78d7+a14128c129,gf63283c776+ede3a706f7,gfed783d017+0c5d6105b6,w.2022.47
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 |
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.
Definition at line 330 of file Log.cc.
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. |
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 | ) |