summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-04-29 17:59:56 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2018-04-29 17:59:56 (GMT)
commit187b4b1b28cd62843612cf43594d9ad7ad4dbf65 (patch)
treedc3ba1c9ad0b23c55711a4ea8b399c227bedb4a0
parenta354701fae8bd35de5accba4d3f3af290126b98a (diff)
downloadlasso-187b4b1b28cd62843612cf43594d9ad7ad4dbf65.zip
lasso-187b4b1b28cd62843612cf43594d9ad7ad4dbf65.tar.gz
lasso-187b4b1b28cd62843612cf43594d9ad7ad4dbf65.tar.bz2
python: route logs for libxml2 and libxmlsec2 to their own logger
-rw-r--r--bindings/python/wrapper_top.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/bindings/python/wrapper_top.c b/bindings/python/wrapper_top.c
index ac930f9..2bdf1c8 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) {