|
LSSTApplications
11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
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... | |
| 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 std::string | getDefaultLoggerName () |
| Get the current default logger name. 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 | pushContext (std::string const &name) |
| Pushes NAME onto the global hierarchical default logger name. More... | |
| static void | popContext () |
| Pops the last pushed name off the global hierarchical default logger 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) |
Private Member Functions | |
| Log (log4cxx::LoggerPtr const &logger) | |
| Construct a Log using a LOG4CXX logger. More... | |
Static Private Member Functions | |
| static log4cxx::LoggerPtr const & | _defaultLogger (log4cxx::LoggerPtr const &newDefault=log4cxx::LoggerPtr()) |
| Returns default LOG4CXX logger. More... | |
Private Attributes | |
| log4cxx::LoggerPtr | _logger |
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 |
Definition at line 732 of file Log.h.
|
inlineprivate |
|
staticprivate |
Returns default LOG4CXX logger.
| newDefault | if non-zero then default is set to this value first. |
|
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 173 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 196 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 213 of file Log.cc.
|
inlinestatic |
Return default logger instance, same as default constructor.
Definition at line 765 of file Log.h.
|
static |
Get the current default logger name.
Definition at line 231 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 254 of file Log.cc.
| std::string lsst::log::Log::getName | ( | ) | const |
|
inline |
| bool lsst::log::Log::isEnabledFor | ( | int | level | ) | const |
|
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 375 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}.
| key | Unique key. |
| value | String value. |
|
static |
|
static |
|
static |
Pops the last pushed name off the global hierarchical default logger name.
Definition at line 293 of file Log.cc.
|
static |
Pushes NAME onto the global hierarchical default logger name.
| name | String to push onto logging context. |
Definition at line 266 of file Log.cc.
| void lsst::log::Log::setLevel | ( | int | level | ) |
1.8.5