From b42ce25b6ee4ac71ae70334ae0a3c2d6e21ba8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Wed, 4 May 2022 19:14:29 +0200 Subject: [PATCH] Set default logging handler. --- src/runner/pythonutils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runner/pythonutils.cpp b/src/runner/pythonutils.cpp index 5361722..349c722 100644 --- a/src/runner/pythonutils.cpp +++ b/src/runner/pythonutils.cpp @@ -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