LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
Go to the documentation of this file.
23 #include "pybind11/pybind11.h"
44 auto state = PyGILState_Ensure();
45 PyObject_CallObject(_callable,
nullptr);
46 PyGILState_Release(state);
54 py::class_<Log>
cls(mod,
"Log");
57 cls.def(py::init<>());
60 cls.attr(
"TRACE") = py::int_(5000);
61 cls.attr(
"DEBUG") = py::int_(10000);
62 cls.attr(
"INFO") = py::int_(20000);
63 cls.attr(
"WARN") = py::int_(30000);
64 cls.attr(
"ERROR") = py::int_(40000);
65 cls.attr(
"FATAL") = py::int_(50000);
80 log.logMsg(log4cxx::Level::toLevel(level),
81 log4cxx::spi::LocationInfo(filename.
c_str(), funcname.
c_str(), lineno), msg.
c_str());
93 cls.def_static(
"MDCRegisterInit", [](py::function func) {
94 auto handle = func.release();
static void MDCRemove(std::string const &key)
Remove the value associated with KEY within the MDC.
int getLevel() const
Retrieve the logging threshold.
bool isEnabledFor(int level) const
Return whether the logging threshold of the logger is less than or equal to LEVEL.
static Log getLogger(Log const &logger)
static void configure_prop(std::string const &properties)
Configures log4cxx using a string containing the list of properties, equivalent to configuring from a...
callable_wrapper(PyObject *callable)
bool isWarnEnabled() const
Check whether the logger is enabled for the WARN Level.
bool isTraceEnabled() const
Check whether the logger is enabled for the TRACE Level.
bool isFatalEnabled() const
Check whether the logger is enabled for the FATAL Level.
PYBIND11_MODULE(log, mod)
unsigned lwpID()
Function which returns LWP ID on platforms which support it.
static void configure()
Explicitly configures log4cxx and initializes logging system.
std::string getName() const
Get the logger name associated with the Log object.
static Log getDefaultLogger()
Return default logger instance, same as default constructor.
bool isDebugEnabled() const
Check whether the logger is enabled for the DEBUG Level.
A base class for image defects.
static int MDCRegisterInit(std::function< void()> function)
bool isInfoEnabled() const
Check whether the logger is enabled for the INFO Level.
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.
This static class includes a variety of methods for interacting with the the logging module.
Log getChild(std::string const &suffix) const
Return a logger which is a descendant to this logger.
LSST DM logging module built on log4cxx.
void setLevel(int level)
Set the logging threshold to LEVEL.
bool isErrorEnabled() const
Check whether the logger is enabled for the ERROR Level.