diff --git a/libnymea-core/integrations/python/pyutils.h b/libnymea-core/integrations/python/pyutils.h index 65f653ff..f18bbd19 100644 --- a/libnymea-core/integrations/python/pyutils.h +++ b/libnymea-core/integrations/python/pyutils.h @@ -3,10 +3,11 @@ #include -#include "loggingcategories.h" - +#include #include +Q_DECLARE_LOGGING_CATEGORY(dcPythonIntegrations) + /* Returns a new reference to PyObject*. */ PyObject *QVariantToPyObject(const QVariant &value) { @@ -76,7 +77,7 @@ PyObject* pyLog_write(PyObject* /*self*/, PyObject* args) if (!PyArg_ParseTuple(args, "s", &what)) return nullptr; if (!QByteArray(what).trimmed().isEmpty()) { - qCDebug(dcThingManager()) << what; + qCDebug(dcPythonIntegrations()) << what; } Py_RETURN_NONE; } @@ -111,7 +112,7 @@ PyObject* pyWarn_write(PyObject* /*self*/, PyObject* args) if (!PyArg_ParseTuple(args, "s", &what)) return nullptr; if (!QByteArray(what).trimmed().isEmpty()) { - qCWarning(dcThingManager()) << what; + qCWarning(dcPythonIntegrations()) << what; } Py_RETURN_NONE; } diff --git a/libnymea-core/integrations/pythonintegrationplugin.cpp b/libnymea-core/integrations/pythonintegrationplugin.cpp index abe434e0..6b09d409 100644 --- a/libnymea-core/integrations/pythonintegrationplugin.cpp +++ b/libnymea-core/integrations/pythonintegrationplugin.cpp @@ -14,6 +14,8 @@ #include #include +NYMEA_LOGGING_CATEGORY(dcPythonIntegrations, "PythonIntegrations") + PyThreadState* PythonIntegrationPlugin::s_mainThreadState = nullptr; QHash PythonIntegrationPlugin::s_plugins; diff --git a/libnymea/loggingcategories.cpp b/libnymea/loggingcategories.cpp index d5d4cfd0..4d5070c7 100644 --- a/libnymea/loggingcategories.cpp +++ b/libnymea/loggingcategories.cpp @@ -75,7 +75,6 @@ NYMEA_LOGGING_CATEGORY(dcBluetoothServerTraffic, "BluetoothServerTraffic") NYMEA_LOGGING_CATEGORY(dcMqtt, "Mqtt") NYMEA_LOGGING_CATEGORY(dcTranslations, "Translations") NYMEA_LOGGING_CATEGORY(dcI2C, "I2C") -NYMEA_LOGGING_CATEGORY(dcPythonIntegrations, "PythonIntegrations") static QFile s_logFile; diff --git a/libnymea/loggingcategories.h b/libnymea/loggingcategories.h index 68557d79..dfb88212 100644 --- a/libnymea/loggingcategories.h +++ b/libnymea/loggingcategories.h @@ -91,7 +91,6 @@ Q_DECLARE_LOGGING_CATEGORY(dcCoap) Q_DECLARE_LOGGING_CATEGORY(dcI2C) Q_DECLARE_LOGGING_CATEGORY(dcIntegrations) Q_DECLARE_LOGGING_CATEGORY(dcJsIntegrations) -Q_DECLARE_LOGGING_CATEGORY(dcPythonIntegrations) /*