LSST Applications g034a557a3c+dd8dd8f11d,g0afe43252f+b86e4b8053,g11f7dcd041+017865fdd3,g1cd03abf6b+8446defddb,g1ce3e0751c+f991eae79d,g28da252d5a+ca8a1a9fb3,g2bbee38e9b+b6588ad223,g2bc492864f+b6588ad223,g2cdde0e794+8523d0dbb4,g347aa1857d+b6588ad223,g35bb328faa+b86e4b8053,g3a166c0a6a+b6588ad223,g461a3dce89+b86e4b8053,g52b1c1532d+b86e4b8053,g7f3b0d46df+ad13c1b82d,g80478fca09+f29c5d6c70,g858d7b2824+293f439f82,g8cd86fa7b1+af721d2595,g965a9036f2+293f439f82,g979bb04a14+51ed57f74c,g9ddcbc5298+f24b38b85a,gae0086650b+b86e4b8053,gbb886bcc26+b97e247655,gc28159a63d+b6588ad223,gc30aee3386+a2f0f6cab9,gcaf7e4fdec+293f439f82,gcd45df26be+293f439f82,gcdd4ae20e8+70b5def7e6,gce08ada175+da9c58a417,gcf0d15dbbd+70b5def7e6,gdaeeff99f8+006e14e809,gdbce86181e+6a170ce272,ge3d4d395c2+224150c836,ge5f7162a3a+bb2241c923,ge6cb8fbbf7+d119aed356,ge79ae78c31+b6588ad223,gf048a9a2f4+40ffced2b8,gf0baf85859+b4cca3d10f,w.2024.30
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
lsst::log Namespace Reference

Namespaces

namespace  detail
 
namespace  log
 
namespace  utils
 
namespace  version
 

Classes

class  callable_wrapper
 
class  Log
 This static class includes a variety of methods for interacting with the the logging module. More...
 
class  LogMDCScope
 

Functions

unsigned lwpID ()
 Function which returns LWP ID on platforms which support it.
 
 PYBIND11_MODULE (log, mod)
 

Function Documentation

◆ lwpID()

unsigned lsst::log::lwpID ( )

Function which returns LWP ID on platforms which support it.

On all other platforms a small incremental integer number (counting number of threads) is returned. This function can be used to produce more human-friendly thread ID for logging instead of regular t format.

Definition at line 425 of file Log.cc.

425 {
426 return detail::lwpID();
427}

◆ PYBIND11_MODULE()

lsst::log::PYBIND11_MODULE ( log ,
mod  )

Definition at line 54 of file log.cc.

54 {
55 py::class_<Log> cls(mod, "Log");
56
57 /* Constructors */
58 cls.def(py::init<>());
59
60 /* Members */
61 cls.attr("TRACE") = py::int_(5000);
62 cls.attr("DEBUG") = py::int_(10000);
63 cls.attr("INFO") = py::int_(20000);
64 cls.attr("WARN") = py::int_(30000);
65 cls.attr("ERROR") = py::int_(40000);
66 cls.attr("FATAL") = py::int_(50000);
67
68 cls.def("isDebugEnabled", &Log::isDebugEnabled);
69 cls.def("isErrorEnabled", &Log::isErrorEnabled);
70 cls.def("isFatalEnabled", &Log::isFatalEnabled);
71 cls.def("isInfoEnabled", &Log::isInfoEnabled);
72 cls.def("isTraceEnabled", &Log::isTraceEnabled);
73 cls.def("isWarnEnabled", &Log::isWarnEnabled);
74 cls.def("getName", &Log::getName);
75 cls.def("setLevel", &Log::setLevel);
76 cls.def("getLevel", &Log::getLevel);
77 cls.def("getEffectiveLevel", &Log::getEffectiveLevel);
78 cls.def("isEnabledFor", &Log::isEnabledFor);
79 cls.def("getChild", &Log::getChild);
80 cls.def("logMsg", [](Log &log, int level, std::string const &filename, std::string const &funcname,
81 unsigned int lineno, std::string const &msg) {
82 log.logMsg(log4cxx::Level::toLevel(level),
83 log4cxx::spi::LocationInfo(filename.c_str(), log4cxx::spi::LocationInfo::calcShortFileName(filename.c_str()), funcname.c_str(), lineno),
84 msg);
85 });
86 cls.def("lwpID", [](Log const& log) -> unsigned { return lsst::log::lwpID(); });
87
88 cls.def_static("getDefaultLogger", Log::getDefaultLogger);
89 cls.def_static("configure", (void (*)())Log::configure);
90 cls.def_static("configure", (void (*)(std::string const&))Log::configure);
91 cls.def_static("configure_prop", Log::configure_prop);
92 cls.def_static("getLogger", (Log(*)(Log const&))Log::getLogger);
93 cls.def_static("getLogger", (Log(*)(std::string const&))Log::getLogger);
94 cls.def_static("MDC", Log::MDC);
95 cls.def_static("MDCRemove", Log::MDCRemove);
96 cls.def_static("MDCRegisterInit", [](py::function func) {
97 auto handle = func.release(); // will leak as described in callable_wrapper
98 Log::MDCRegisterInit(std::function<void()>(callable_wrapper(handle.ptr())));
99 });
100}
T c_str(T... args)
This static class includes a variety of methods for interacting with the the logging module.
Definition Log.h:724
unsigned lwpID()
Function which returns LWP ID on platforms which support it.
Definition Log.cc:425