Python plugin provider: log if Python interpreter is already initialized
[babeltrace.git] / python-plugin-provider / python-plugin-provider.c
index a07e187f7ddb95c2226f11110c35822df3e02f7b..2cb5a7334f82169b608d557180875e9f619dd3ec 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #define BT_LOG_TAG "PLUGIN-PY"
-#include <babeltrace/lib-logging-internal.h>
+#include "logging.h"
 
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/compiler-internal.h>
@@ -99,9 +99,13 @@ void init_python(void)
        }
 
        if (!Py_IsInitialized()) {
+               BT_LOGI_STR("Python interpreter is not initialized: initializing Python interpreter.");
                Py_InitializeEx(0);
                BT_LOGI("Initialized Python interpreter: version=\"%s\"",
                        Py_GetVersion());
+       } else {
+               BT_LOGI("Python interpreter is already initialized: version=\"%s\"",
+                       Py_GetVersion());
        }
 
        py_bt2_py_plugin_mod = PyImport_ImportModule("bt2.py_plugin");
This page took 0.024515 seconds and 4 git commands to generate.