Set default logging handler.

This commit is contained in:
Mikaël Capelle
2022-05-04 19:14:29 +02:00
parent fa33e42e22
commit b42ce25b6e
+4 -1
View File
@@ -94,7 +94,7 @@ namespace mo2::python {
// This is the function we are going to use as our Handler .emit
// method.
void emit_function(py::object self, py::object record)
void emit_function(py::object record)
{
// There are other parameters that could be used, but this is minimal
@@ -148,6 +148,9 @@ namespace mo2::python {
// set mobase attributes
mobase.attr("LogHandler") = MO2Handler;
mobase.attr("logger") = logger;
logging.attr("root").attr("setLevel")(PyLogLevel::DEBUG);
logging.attr("root").attr("addHandler")(handler);
}
} // namespace mo2::python