LSSTApplications
17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
|
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... | |
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 void | 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 351 of file Log.cc.
|
inlinestatic |
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 |
Definition at line 371 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 273 of file Log.cc.
|
static |
|
static |
Remove the value associated with KEY within the MDC.
key | Key identifying value to remove. |
void lsst::log::Log::setLevel | ( | int | level | ) |