From 187b4b1b28cd62843612cf43594d9ad7ad4dbf65 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sun, 29 Apr 2018 19:59:56 +0200 Subject: [PATCH] python: route logs for libxml2 and libxmlsec2 to their own logger --- bindings/python/wrapper_top.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/wrapper_top.c b/bindings/python/wrapper_top.c index ac930f9e..2bdf1c85 100644 --- a/bindings/python/wrapper_top.c +++ b/bindings/python/wrapper_top.c @@ -674,7 +674,7 @@ set_object_field(GObject **a_gobject_ptr, PyGObjectPtr *a_pygobject) { } -static PyObject *get_logger_object() { +static PyObject *get_logger_object(const char *domain) { static PyObject *_logger_object = NULL; PyObject *logging_module = PyImport_ImportModule("lasso"); @@ -693,7 +693,7 @@ static PyObject *get_logger_object() { logging_module = PyImport_ImportModule("logging"); if (logging_module) { _logger_object = PyObject_CallMethod(logging_module, "getLogger", - "s#", "lasso", sizeof("lasso")-1); + "s#", domain, strlen(domain)); Py_DECREF(logging_module); } exit: @@ -705,10 +705,10 @@ exit: } static void -lasso_python_log(G_GNUC_UNUSED const char *domain, GLogLevelFlags log_level, const gchar *message, +lasso_python_log(const char *domain, GLogLevelFlags log_level, const gchar *message, G_GNUC_UNUSED gpointer user_data) { - PyObject *logger_object = get_logger_object(), *result; + PyObject *logger_object = get_logger_object(domain), *result; char *method = NULL; if (! logger_object) {