From 3d594e16dd3850973336c70014a948dc97837d39 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 8 Jul 2025 13:39:34 -0700 Subject: [PATCH] core/log: track default logging categories Fixes a bug in fb37be7 which ignored default logging categories due to skipping QLoggingRegistry's filter. --- src/bluetooth/adapter.cpp | 3 +- src/bluetooth/bluez.cpp | 10 +++++-- src/bluetooth/bluez.hpp | 13 +++++++-- src/bluetooth/device.cpp | 3 +- src/core/colorquantizer.cpp | 4 ++- src/core/desktopentry.cpp | 3 +- src/core/generation.cpp | 3 +- src/core/incubator.cpp | 5 ++-- src/core/incubator.hpp | 5 ++-- src/core/logcat.hpp | 28 +++++++++++++++++++ src/core/logging.cpp | 23 +++++++++++---- src/core/logging.hpp | 8 +++++- src/core/logging_qtprivate.cpp | 3 +- src/core/logging_qtprivate.hpp | 4 ++- src/core/paths.cpp | 3 +- src/core/qsintercept.cpp | 4 ++- src/core/qsintercept.hpp | 4 ++- src/core/scan.cpp | 4 ++- src/core/scan.hpp | 4 ++- src/crash/handler.cpp | 3 +- src/crash/main.cpp | 3 +- src/dbus/bus.cpp | 4 ++- src/dbus/dbusmenu/dbusmenu.cpp | 3 +- src/dbus/dbusmenu/dbusmenu.hpp | 2 +- src/dbus/objectmanager.cpp | 3 +- src/dbus/properties.cpp | 3 +- src/dbus/properties.hpp | 3 +- src/debug/lint.cpp | 4 ++- src/io/fileview.cpp | 3 +- src/io/socket.cpp | 3 +- src/io/socket.hpp | 3 +- src/ipc/ipc.cpp | 3 +- src/ipc/ipc.hpp | 4 ++- src/services/greetd/connection.cpp | 3 +- src/services/mpris/player.cpp | 3 +- src/services/mpris/watcher.cpp | 3 +- src/services/notifications/dbusimage.cpp | 4 ++- src/services/notifications/notification.cpp | 3 +- src/services/notifications/server.cpp | 3 +- src/services/pam/conversation.cpp | 3 +- src/services/pam/conversation.hpp | 3 +- src/services/pipewire/core.cpp | 4 ++- src/services/pipewire/defaults.cpp | 3 +- src/services/pipewire/device.cpp | 3 +- src/services/pipewire/link.cpp | 3 +- src/services/pipewire/metadata.cpp | 3 +- src/services/pipewire/node.cpp | 3 +- src/services/pipewire/registry.cpp | 3 +- src/services/pipewire/registry.hpp | 3 +- src/services/status_notifier/host.cpp | 3 +- src/services/status_notifier/host.hpp | 3 +- src/services/status_notifier/item.cpp | 3 +- src/services/status_notifier/item.hpp | 3 +- src/services/status_notifier/watcher.cpp | 4 ++- src/services/status_notifier/watcher.hpp | 4 ++- src/services/upower/core.cpp | 3 +- src/services/upower/device.cpp | 3 +- src/services/upower/powerprofiles.cpp | 3 +- src/wayland/buffer/dmabuf.cpp | 3 +- src/wayland/buffer/manager.cpp | 3 +- src/wayland/buffer/shm.cpp | 3 +- src/wayland/hyprland/ipc/connection.cpp | 5 ++-- .../hyprland_screencopy.cpp | 3 +- .../image_copy_capture/image_copy_capture.cpp | 3 +- .../wlr_screencopy/wlr_screencopy.cpp | 3 +- src/wayland/toplevel_management/manager.cpp | 3 +- src/wayland/toplevel_management/manager.hpp | 3 +- src/x11/i3/ipc/connection.cpp | 5 ++-- 68 files changed, 212 insertions(+), 79 deletions(-) create mode 100644 src/core/logcat.hpp diff --git a/src/bluetooth/adapter.cpp b/src/bluetooth/adapter.cpp index e24b13ab..92ab8379 100644 --- a/src/bluetooth/adapter.cpp +++ b/src/bluetooth/adapter.cpp @@ -12,13 +12,14 @@ #include #include +#include "../core/logcat.hpp" #include "../dbus/properties.hpp" #include "dbus_adapter.h" namespace qs::bluetooth { namespace { -Q_LOGGING_CATEGORY(logAdapter, "quickshell.bluetooth.adapter", QtWarningMsg); +QS_LOGGING_CATEGORY(logAdapter, "quickshell.bluetooth.adapter", QtWarningMsg); } QString BluetoothAdapterState::toString(BluetoothAdapterState::Enum state) { diff --git a/src/bluetooth/bluez.cpp b/src/bluetooth/bluez.cpp index 6ff2e307..f2c4300d 100644 --- a/src/bluetooth/bluez.cpp +++ b/src/bluetooth/bluez.cpp @@ -8,6 +8,7 @@ #include #include +#include "../core/logcat.hpp" #include "../dbus/dbus_objectmanager_types.hpp" #include "../dbus/objectmanager.hpp" #include "adapter.hpp" @@ -16,7 +17,7 @@ namespace qs::bluetooth { namespace { -Q_LOGGING_CATEGORY(logBluetooth, "quickshell.bluetooth", QtWarningMsg); +QS_LOGGING_CATEGORY(logBluetooth, "quickshell.bluetooth", QtWarningMsg); } Bluez* Bluez::instance() { @@ -156,7 +157,12 @@ void Bluez::onInterfacesRemoved(const QDBusObjectPath& path, const QStringList& } BluezQml::BluezQml() { - QObject::connect(Bluez::instance(), &Bluez::defaultAdapterChanged, this, &BluezQml::defaultAdapterChanged); + QObject::connect( + Bluez::instance(), + &Bluez::defaultAdapterChanged, + this, + &BluezQml::defaultAdapterChanged + ); } } // namespace qs::bluetooth diff --git a/src/bluetooth/bluez.hpp b/src/bluetooth/bluez.hpp index a0c12679..9d7c93ca 100644 --- a/src/bluetooth/bluez.hpp +++ b/src/bluetooth/bluez.hpp @@ -50,13 +50,21 @@ private: ObjectModel mDevices {this}; public: - Q_OBJECT_BINDABLE_PROPERTY(Bluez, BluetoothAdapter*, bDefaultAdapter, &Bluez::defaultAdapterChanged); + Q_OBJECT_BINDABLE_PROPERTY( + Bluez, + BluetoothAdapter*, + bDefaultAdapter, + &Bluez::defaultAdapterChanged + ); }; ///! Bluetooth manager /// Provides access to bluetooth devices and adapters. class BluezQml: public QObject { Q_OBJECT; + QML_NAMED_ELEMENT(Bluetooth); + QML_SINGLETON; + // clang-format off /// The default bluetooth adapter. Usually there is only one. Q_PROPERTY(BluetoothAdapter* defaultAdapter READ default NOTIFY defaultAdapterChanged BINDABLE bindableDefaultAdapter); QSDOC_TYPE_OVERRIDE(ObjectModel*); @@ -66,8 +74,7 @@ class BluezQml: public QObject { /// A list of all connected bluetooth devices across all adapters. /// See @@BluetoothAdapter.devices for the devices connected to a single adapter. Q_PROPERTY(UntypedObjectModel* devices READ devices CONSTANT); - QML_NAMED_ELEMENT(Bluetooth); - QML_SINGLETON; + // clang-format on signals: void defaultAdapterChanged(); diff --git a/src/bluetooth/device.cpp b/src/bluetooth/device.cpp index 30008a32..7265b241 100644 --- a/src/bluetooth/device.cpp +++ b/src/bluetooth/device.cpp @@ -12,6 +12,7 @@ #include #include +#include "../core/logcat.hpp" #include "../dbus/properties.hpp" #include "adapter.hpp" #include "bluez.hpp" @@ -20,7 +21,7 @@ namespace qs::bluetooth { namespace { -Q_LOGGING_CATEGORY(logDevice, "quickshell.bluetooth.device", QtWarningMsg); +QS_LOGGING_CATEGORY(logDevice, "quickshell.bluetooth.device", QtWarningMsg); } QString BluetoothDeviceState::toString(BluetoothDeviceState::Enum state) { diff --git a/src/core/colorquantizer.cpp b/src/core/colorquantizer.cpp index 667942c2..9f443b81 100644 --- a/src/core/colorquantizer.cpp +++ b/src/core/colorquantizer.cpp @@ -18,8 +18,10 @@ #include #include +#include "logcat.hpp" + namespace { -Q_LOGGING_CATEGORY(logColorQuantizer, "quickshell.colorquantizer", QtWarningMsg); +QS_LOGGING_CATEGORY(logColorQuantizer, "quickshell.colorquantizer", QtWarningMsg); } ColorQuantizerOperation::ColorQuantizerOperation(QUrl* source, qreal depth, qreal rescaleSize) diff --git a/src/core/desktopentry.cpp b/src/core/desktopentry.cpp index 541207ee..3c4b6f26 100644 --- a/src/core/desktopentry.cpp +++ b/src/core/desktopentry.cpp @@ -17,10 +17,11 @@ #include #include "common.hpp" +#include "logcat.hpp" #include "model.hpp" namespace { -Q_LOGGING_CATEGORY(logDesktopEntry, "quickshell.desktopentry", QtWarningMsg); +QS_LOGGING_CATEGORY(logDesktopEntry, "quickshell.desktopentry", QtWarningMsg); } struct Locale { diff --git a/src/core/generation.cpp b/src/core/generation.cpp index 1189ab72..d99409bb 100644 --- a/src/core/generation.cpp +++ b/src/core/generation.cpp @@ -21,13 +21,14 @@ #include "iconimageprovider.hpp" #include "imageprovider.hpp" #include "incubator.hpp" +#include "logcat.hpp" #include "plugin.hpp" #include "qsintercept.hpp" #include "reload.hpp" #include "scan.hpp" namespace { -Q_LOGGING_CATEGORY(logScene, "scene"); +QS_LOGGING_CATEGORY(logScene, "scene"); } static QHash g_generations; // NOLINT diff --git a/src/core/incubator.cpp b/src/core/incubator.cpp index c43703a6..c9d149a8 100644 --- a/src/core/incubator.cpp +++ b/src/core/incubator.cpp @@ -1,11 +1,12 @@ #include "incubator.hpp" #include -#include #include #include -Q_LOGGING_CATEGORY(logIncubator, "quickshell.incubator", QtWarningMsg); +#include "logcat.hpp" + +QS_LOGGING_CATEGORY(logIncubator, "quickshell.incubator", QtWarningMsg); void QsQmlIncubator::statusChanged(QQmlIncubator::Status status) { switch (status) { diff --git a/src/core/incubator.hpp b/src/core/incubator.hpp index 5928ffe9..5ebb9a0e 100644 --- a/src/core/incubator.hpp +++ b/src/core/incubator.hpp @@ -1,11 +1,12 @@ #pragma once -#include #include #include #include -Q_DECLARE_LOGGING_CATEGORY(logIncubator); +#include "logcat.hpp" + +QS_DECLARE_LOGGING_CATEGORY(logIncubator); class QsQmlIncubator : public QObject diff --git a/src/core/logcat.hpp b/src/core/logcat.hpp new file mode 100644 index 00000000..9650ddbf --- /dev/null +++ b/src/core/logcat.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include +#include + +namespace qs::log { +void initLogCategoryLevel(const char* name, QtMsgType defaultLevel = QtDebugMsg); +} + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define QS_DECLARE_LOGGING_CATEGORY(name) \ + namespace qslogcat { \ + Q_DECLARE_LOGGING_CATEGORY(name); \ + } \ + const QLoggingCategory& name() + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define QS_LOGGING_CATEGORY(name, category, ...) \ + namespace qslogcat { \ + Q_LOGGING_CATEGORY(name, category __VA_OPT__(, __VA_ARGS__)); \ + } \ + const QLoggingCategory& name() { \ + static auto* init = []() { \ + qs::log::initLogCategoryLevel(category __VA_OPT__(, __VA_ARGS__)); \ + return &qslogcat::name; \ + }(); \ + return (init) (); \ + } diff --git a/src/core/logging.cpp b/src/core/logging.cpp index d9f3f57c..7f95e46f 100644 --- a/src/core/logging.cpp +++ b/src/core/logging.cpp @@ -30,17 +30,18 @@ #include #include "instanceinfo.hpp" +#include "logcat.hpp" #include "logging_p.hpp" #include "logging_qtprivate.cpp" // NOLINT #include "paths.hpp" #include "ringbuf.hpp" -Q_LOGGING_CATEGORY(logBare, "quickshell.bare"); +QS_LOGGING_CATEGORY(logBare, "quickshell.bare"); namespace qs::log { using namespace qt_logging_registry; -Q_LOGGING_CATEGORY(logLogging, "quickshell.logging", QtWarningMsg); +QS_LOGGING_CATEGORY(logLogging, "quickshell.logging", QtWarningMsg); bool LogMessage::operator==(const LogMessage& other) const { // note: not including time @@ -187,10 +188,16 @@ void LogManager::filterCategory(QLoggingCategory* category) { // We don't respect log filters for qs logs because some distros like to ship // default configs that hide everything. QT_LOGGING_RULES is considered via the filter list. if (isQs) { - filter.debug = instance->mDefaultLevel == QtDebugMsg; - filter.info = instance->mDefaultLevel == QtInfoMsg; - filter.warn = instance->mDefaultLevel == QtWarningMsg; - filter.critical = instance->mDefaultLevel == QtCriticalMsg; + // QtDebugMsg == 0, so default + auto defaultLevel = instance->defaultLevels.value(categoryName); + + filter = CategoryFilter(); + // clang-format off + filter.debug = instance->mDefaultLevel == QtDebugMsg || defaultLevel == QtDebugMsg; + filter.info = filter.debug || instance->mDefaultLevel == QtInfoMsg || defaultLevel == QtInfoMsg; + filter.warn = filter.info || instance->mDefaultLevel == QtWarningMsg || defaultLevel == QtWarningMsg; + filter.critical = filter.warn || instance->mDefaultLevel == QtCriticalMsg || defaultLevel == QtCriticalMsg; + // clang-format on } else if (instance->lastCategoryFilter) { instance->lastCategoryFilter(category); filter = CategoryFilter(category); @@ -262,6 +269,10 @@ void LogManager::init( qCDebug(logLogging) << "Logger initialized."; } +void initLogCategoryLevel(const char* name, QtMsgType defaultLevel) { + LogManager::instance()->defaultLevels.insert(QLatin1StringView(name), defaultLevel); +} + void LogManager::initFs() { QMetaObject::invokeMethod( &LogManager::instance()->threadProxy, diff --git a/src/core/logging.hpp b/src/core/logging.hpp index 7ff1b5e0..bf811333 100644 --- a/src/core/logging.hpp +++ b/src/core/logging.hpp @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -12,7 +13,9 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(logBare); +#include "logcat.hpp" + +QS_DECLARE_LOGGING_CATEGORY(logBare); namespace qs::log { @@ -127,11 +130,14 @@ private: QString mRulesString; QList* rules = nullptr; QtMsgType mDefaultLevel = QtWarningMsg; + QHash defaultLevels; QHash sparseFilters; QHash allFilters; QTextStream stdoutStream; LoggingThreadProxy threadProxy; + + friend void initLogCategoryLevel(const char* name, QtMsgType defaultLevel); }; bool readEncodedLogs( diff --git a/src/core/logging_qtprivate.cpp b/src/core/logging_qtprivate.cpp index 5078eeb4..48f74dee 100644 --- a/src/core/logging_qtprivate.cpp +++ b/src/core/logging_qtprivate.cpp @@ -16,10 +16,11 @@ #include #include +#include "logcat.hpp" #include "logging_qtprivate.hpp" namespace qs::log { -Q_DECLARE_LOGGING_CATEGORY(logLogging); +QS_DECLARE_LOGGING_CATEGORY(logLogging); namespace qt_logging_registry { diff --git a/src/core/logging_qtprivate.hpp b/src/core/logging_qtprivate.hpp index 83c82585..61d3a7cf 100644 --- a/src/core/logging_qtprivate.hpp +++ b/src/core/logging_qtprivate.hpp @@ -12,8 +12,10 @@ #include #include +#include "logcat.hpp" + namespace qs::log { -Q_DECLARE_LOGGING_CATEGORY(logLogging); +QS_DECLARE_LOGGING_CATEGORY(logLogging); namespace qt_logging_registry { diff --git a/src/core/paths.cpp b/src/core/paths.cpp index 73ce7159..2c341bbb 100644 --- a/src/core/paths.cpp +++ b/src/core/paths.cpp @@ -16,9 +16,10 @@ #include #include "instanceinfo.hpp" +#include "logcat.hpp" namespace { -Q_LOGGING_CATEGORY(logPaths, "quickshell.paths", QtWarningMsg); +QS_LOGGING_CATEGORY(logPaths, "quickshell.paths"); } QsPaths* QsPaths::instance() { diff --git a/src/core/qsintercept.cpp b/src/core/qsintercept.cpp index 12ca1188..560331d9 100644 --- a/src/core/qsintercept.cpp +++ b/src/core/qsintercept.cpp @@ -14,7 +14,9 @@ #include #include -Q_LOGGING_CATEGORY(logQsIntercept, "quickshell.interceptor", QtWarningMsg); +#include "logcat.hpp" + +QS_LOGGING_CATEGORY(logQsIntercept, "quickshell.interceptor", QtWarningMsg); QUrl QsUrlInterceptor::intercept( const QUrl& originalUrl, diff --git a/src/core/qsintercept.hpp b/src/core/qsintercept.hpp index 81137499..f0e10981 100644 --- a/src/core/qsintercept.hpp +++ b/src/core/qsintercept.hpp @@ -10,7 +10,9 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(logQsIntercept); +#include "logcat.hpp" + +QS_DECLARE_LOGGING_CATEGORY(logQsIntercept); class QsUrlInterceptor: public QQmlAbstractUrlInterceptor { public: diff --git a/src/core/scan.cpp b/src/core/scan.cpp index 8d6362e8..90b19b5a 100644 --- a/src/core/scan.cpp +++ b/src/core/scan.cpp @@ -15,7 +15,9 @@ #include #include -Q_LOGGING_CATEGORY(logQmlScanner, "quickshell.qmlscanner", QtWarningMsg); +#include "logcat.hpp" + +QS_LOGGING_CATEGORY(logQmlScanner, "quickshell.qmlscanner", QtWarningMsg); void QmlScanner::scanDir(const QString& path) { if (this->scannedDirs.contains(path)) return; diff --git a/src/core/scan.hpp b/src/core/scan.hpp index d8fb5009..80b44ca0 100644 --- a/src/core/scan.hpp +++ b/src/core/scan.hpp @@ -6,7 +6,9 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(logQmlScanner); +#include "logcat.hpp" + +QS_DECLARE_LOGGING_CATEGORY(logQmlScanner); // expects canonical paths class QmlScanner { diff --git a/src/crash/handler.cpp b/src/crash/handler.cpp index 8d9a8a71..1433a879 100644 --- a/src/crash/handler.cpp +++ b/src/crash/handler.cpp @@ -15,6 +15,7 @@ #include #include "../core/instanceinfo.hpp" +#include "../core/logcat.hpp" extern char** environ; // NOLINT @@ -23,7 +24,7 @@ using namespace google_breakpad; namespace qs::crash { namespace { -Q_LOGGING_CATEGORY(logCrashHandler, "quickshell.crashhandler", QtWarningMsg); +QS_LOGGING_CATEGORY(logCrashHandler, "quickshell.crashhandler", QtWarningMsg); } struct CrashHandlerPrivate { diff --git a/src/crash/main.cpp b/src/crash/main.cpp index 7c3bad73..fb53a56c 100644 --- a/src/crash/main.cpp +++ b/src/crash/main.cpp @@ -17,6 +17,7 @@ #include #include "../core/instanceinfo.hpp" +#include "../core/logcat.hpp" #include "../core/logging.hpp" #include "../core/paths.hpp" #include "build.hpp" @@ -24,7 +25,7 @@ namespace { -Q_LOGGING_CATEGORY(logCrashReporter, "quickshell.crashreporter", QtWarningMsg); +QS_LOGGING_CATEGORY(logCrashReporter, "quickshell.crashreporter", QtWarningMsg); int tryDup(int fd, const QString& path) { QFile sourceFile; diff --git a/src/dbus/bus.cpp b/src/dbus/bus.cpp index dc6d21bf..d53c4c6b 100644 --- a/src/dbus/bus.cpp +++ b/src/dbus/bus.cpp @@ -12,10 +12,12 @@ #include #include +#include "../core/logcat.hpp" + namespace qs::dbus { namespace { -Q_LOGGING_CATEGORY(logDbus, "quickshell.dbus", QtWarningMsg); +QS_LOGGING_CATEGORY(logDbus, "quickshell.dbus", QtWarningMsg); } void tryLaunchService( diff --git a/src/dbus/dbusmenu/dbusmenu.cpp b/src/dbus/dbusmenu/dbusmenu.cpp index 2b633b76..c0b4386f 100644 --- a/src/dbus/dbusmenu/dbusmenu.cpp +++ b/src/dbus/dbusmenu/dbusmenu.cpp @@ -21,13 +21,14 @@ #include #include "../../core/iconimageprovider.hpp" +#include "../../core/logcat.hpp" #include "../../core/model.hpp" #include "../../core/qsmenu.hpp" #include "../../dbus/properties.hpp" #include "dbus_menu.h" #include "dbus_menu_types.hpp" -Q_LOGGING_CATEGORY(logDbusMenu, "quickshell.dbus.dbusmenu", QtWarningMsg); +QS_LOGGING_CATEGORY(logDbusMenu, "quickshell.dbus.dbusmenu", QtWarningMsg); using namespace qs::menu; diff --git a/src/dbus/dbusmenu/dbusmenu.hpp b/src/dbus/dbusmenu/dbusmenu.hpp index 1a8b399e..1192baaa 100644 --- a/src/dbus/dbusmenu/dbusmenu.hpp +++ b/src/dbus/dbusmenu/dbusmenu.hpp @@ -20,7 +20,7 @@ #include "../properties.hpp" #include "dbus_menu_types.hpp" -Q_DECLARE_LOGGING_CATEGORY(logDbusMenu); +QS_DECLARE_LOGGING_CATEGORY(logDbusMenu); class DBusMenuInterface; diff --git a/src/dbus/objectmanager.cpp b/src/dbus/objectmanager.cpp index d7acb74a..258f6fe8 100644 --- a/src/dbus/objectmanager.cpp +++ b/src/dbus/objectmanager.cpp @@ -9,11 +9,12 @@ #include #include +#include "../core/logcat.hpp" #include "dbus_objectmanager.h" #include "dbus_objectmanager_types.hpp" namespace { -Q_LOGGING_CATEGORY(logDbusObjectManager, "quickshell.dbus.objectmanager", QtWarningMsg); +QS_LOGGING_CATEGORY(logDbusObjectManager, "quickshell.dbus.objectmanager", QtWarningMsg); } namespace qs::dbus { diff --git a/src/dbus/properties.cpp b/src/dbus/properties.cpp index 46528d52..81f26d28 100644 --- a/src/dbus/properties.cpp +++ b/src/dbus/properties.cpp @@ -20,9 +20,10 @@ #include #include +#include "../core/logcat.hpp" #include "dbus_properties.h" -Q_LOGGING_CATEGORY(logDbusProperties, "quickshell.dbus.properties", QtWarningMsg); +QS_LOGGING_CATEGORY(logDbusProperties, "quickshell.dbus.properties", QtWarningMsg); namespace qs::dbus { diff --git a/src/dbus/properties.hpp b/src/dbus/properties.hpp index 9cfaee98..a5fce98c 100644 --- a/src/dbus/properties.hpp +++ b/src/dbus/properties.hpp @@ -23,11 +23,12 @@ #include #include +#include "../core/logcat.hpp" #include "../core/util.hpp" class DBusPropertiesInterface; -Q_DECLARE_LOGGING_CATEGORY(logDbusProperties); +QS_DECLARE_LOGGING_CATEGORY(logDbusProperties); namespace qs::dbus { diff --git a/src/debug/lint.cpp b/src/debug/lint.cpp index eb0450f8..dd65a280 100644 --- a/src/debug/lint.cpp +++ b/src/debug/lint.cpp @@ -11,10 +11,12 @@ #include #include +#include "../core/logcat.hpp" + namespace qs::debug { namespace { -Q_LOGGING_CATEGORY(logLint, "quickshell.linter", QtWarningMsg); +QS_LOGGING_CATEGORY(logLint, "quickshell.linter", QtWarningMsg); void lintZeroSized(QQuickItem* item); bool isRenderable(QQuickItem* item); diff --git a/src/io/fileview.cpp b/src/io/fileview.cpp index cbe84172..1585f26f 100644 --- a/src/io/fileview.cpp +++ b/src/io/fileview.cpp @@ -20,12 +20,13 @@ #include #include +#include "../core/logcat.hpp" #include "../core/util.hpp" namespace qs::io { namespace { -Q_LOGGING_CATEGORY(logFileView, "quickshell.io.fileview", QtWarningMsg); +QS_LOGGING_CATEGORY(logFileView, "quickshell.io.fileview", QtWarningMsg); } QString FileViewError::toString(FileViewError::Enum value) { diff --git a/src/io/socket.cpp b/src/io/socket.cpp index 2cf9b625..371f6873 100644 --- a/src/io/socket.cpp +++ b/src/io/socket.cpp @@ -11,9 +11,10 @@ #include #include +#include "../core/logcat.hpp" #include "datastream.hpp" -Q_LOGGING_CATEGORY(logSocket, "quickshell.io.socket", QtWarningMsg); +QS_LOGGING_CATEGORY(logSocket, "quickshell.io.socket", QtWarningMsg); void Socket::setSocket(QLocalSocket* socket) { if (this->socket != nullptr) this->socket->deleteLater(); diff --git a/src/io/socket.hpp b/src/io/socket.hpp index 64605f86..3fd230ef 100644 --- a/src/io/socket.hpp +++ b/src/io/socket.hpp @@ -10,10 +10,11 @@ #include #include +#include "../core/logcat.hpp" #include "../core/reload.hpp" #include "datastream.hpp" -Q_DECLARE_LOGGING_CATEGORY(logSocket); +QS_DECLARE_LOGGING_CATEGORY(logSocket); ///! Unix socket listener. class Socket: public DataStream { diff --git a/src/ipc/ipc.cpp b/src/ipc/ipc.cpp index 3580e2be..bf668015 100644 --- a/src/ipc/ipc.cpp +++ b/src/ipc/ipc.cpp @@ -10,12 +10,13 @@ #include #include "../core/generation.hpp" +#include "../core/logcat.hpp" #include "../core/paths.hpp" #include "ipccommand.hpp" namespace qs::ipc { -Q_LOGGING_CATEGORY(logIpc, "quickshell.ipc", QtWarningMsg); +QS_LOGGING_CATEGORY(logIpc, "quickshell.ipc", QtWarningMsg); IpcServer::IpcServer(const QString& path) { QObject::connect(&this->server, &QLocalServer::newConnection, this, &IpcServer::onNewConnection); diff --git a/src/ipc/ipc.hpp b/src/ipc/ipc.hpp index 77bff913..8ad4c42e 100644 --- a/src/ipc/ipc.hpp +++ b/src/ipc/ipc.hpp @@ -15,6 +15,8 @@ #include #include +#include "../core/logcat.hpp" + template constexpr void assertSerializable() { // monostate being zero ensures transactional reads wont break @@ -109,7 +111,7 @@ DEFINE_SIMPLE_DATASTREAM_OPS(std::monostate); namespace qs::ipc { -Q_DECLARE_LOGGING_CATEGORY(logIpc); +QS_DECLARE_LOGGING_CATEGORY(logIpc); template class MessageStream { diff --git a/src/services/greetd/connection.cpp b/src/services/greetd/connection.cpp index ecfd9a59..bf0d1fdd 100644 --- a/src/services/greetd/connection.cpp +++ b/src/services/greetd/connection.cpp @@ -14,9 +14,10 @@ #include #include "../../core/generation.hpp" +#include "../../core/logcat.hpp" namespace { -Q_LOGGING_CATEGORY(logGreetd, "quickshell.service.greetd"); +QS_LOGGING_CATEGORY(logGreetd, "quickshell.service.greetd"); } QString GreetdState::toString(GreetdState::Enum value) { diff --git a/src/services/mpris/player.cpp b/src/services/mpris/player.cpp index 6730572b..67c562d3 100644 --- a/src/services/mpris/player.cpp +++ b/src/services/mpris/player.cpp @@ -14,6 +14,7 @@ #include #include +#include "../../core/logcat.hpp" #include "../../dbus/properties.hpp" #include "dbus_player.h" #include "dbus_player_app.h" @@ -23,7 +24,7 @@ using namespace qs::dbus; namespace qs::service::mpris { namespace { -Q_LOGGING_CATEGORY(logMprisPlayer, "quickshell.service.mp.player", QtWarningMsg); +QS_LOGGING_CATEGORY(logMprisPlayer, "quickshell.service.mp.player", QtWarningMsg); } QString MprisPlaybackState::toString(MprisPlaybackState::Enum status) { diff --git a/src/services/mpris/watcher.cpp b/src/services/mpris/watcher.cpp index 94619074..fdfe97ad 100644 --- a/src/services/mpris/watcher.cpp +++ b/src/services/mpris/watcher.cpp @@ -9,13 +9,14 @@ #include #include +#include "../../core/logcat.hpp" #include "../../core/model.hpp" #include "player.hpp" namespace qs::service::mpris { namespace { -Q_LOGGING_CATEGORY(logMprisWatcher, "quickshell.service.mpris.watcher", QtWarningMsg); +QS_LOGGING_CATEGORY(logMprisWatcher, "quickshell.service.mpris.watcher", QtWarningMsg); } MprisWatcher::MprisWatcher() { diff --git a/src/services/notifications/dbusimage.cpp b/src/services/notifications/dbusimage.cpp index 9c10e222..e6c091bc 100644 --- a/src/services/notifications/dbusimage.cpp +++ b/src/services/notifications/dbusimage.cpp @@ -7,10 +7,12 @@ #include #include +#include "../../core/logcat.hpp" + namespace qs::service::notifications { // NOLINTNEXTLINE(misc-use-internal-linkage) -Q_DECLARE_LOGGING_CATEGORY(logNotifications); // server.cpp +QS_DECLARE_LOGGING_CATEGORY(logNotifications); // server.cpp QImage DBusNotificationImage::createImage() const { auto format = this->hasAlpha ? QImage::Format_RGBA8888 : QImage::Format_RGB888; diff --git a/src/services/notifications/notification.cpp b/src/services/notifications/notification.cpp index 742d6076..96a2ff09 100644 --- a/src/services/notifications/notification.cpp +++ b/src/services/notifications/notification.cpp @@ -12,13 +12,14 @@ #include "../../core/desktopentry.hpp" #include "../../core/iconimageprovider.hpp" +#include "../../core/logcat.hpp" #include "dbusimage.hpp" #include "server.hpp" namespace qs::service::notifications { // NOLINTNEXTLINE(misc-use-internal-linkage) -Q_DECLARE_LOGGING_CATEGORY(logNotifications); // server.cpp +QS_DECLARE_LOGGING_CATEGORY(logNotifications); // server.cpp QString NotificationUrgency::toString(NotificationUrgency::Enum value) { switch (value) { diff --git a/src/services/notifications/server.cpp b/src/services/notifications/server.cpp index 0c41fb84..18a898aa 100644 --- a/src/services/notifications/server.cpp +++ b/src/services/notifications/server.cpp @@ -12,6 +12,7 @@ #include #include +#include "../../core/logcat.hpp" #include "../../core/model.hpp" #include "dbus_notifications.h" #include "dbusimage.hpp" @@ -20,7 +21,7 @@ namespace qs::service::notifications { // NOLINTNEXTLINE(misc-use-internal-linkage) -Q_LOGGING_CATEGORY(logNotifications, "quickshell.service.notifications"); +QS_LOGGING_CATEGORY(logNotifications, "quickshell.service.notifications"); NotificationServer::NotificationServer() { qDBusRegisterMetaType(); diff --git a/src/services/pam/conversation.cpp b/src/services/pam/conversation.cpp index 07dbd59a..6d27978f 100644 --- a/src/services/pam/conversation.cpp +++ b/src/services/pam/conversation.cpp @@ -8,9 +8,10 @@ #include #include +#include "../../core/logcat.hpp" #include "ipc.hpp" -Q_LOGGING_CATEGORY(logPam, "quickshell.service.pam", QtWarningMsg); +QS_LOGGING_CATEGORY(logPam, "quickshell.service.pam", QtWarningMsg); QString PamError::toString(PamError::Enum value) { switch (value) { diff --git a/src/services/pam/conversation.hpp b/src/services/pam/conversation.hpp index d0f2d97e..779e6f47 100644 --- a/src/services/pam/conversation.hpp +++ b/src/services/pam/conversation.hpp @@ -8,9 +8,10 @@ #include #include +#include "../../core/logcat.hpp" #include "ipc.hpp" -Q_DECLARE_LOGGING_CATEGORY(logPam); +QS_DECLARE_LOGGING_CATEGORY(logPam); ///! The result of an authentication. /// See @@PamContext.completed(s). diff --git a/src/services/pipewire/core.cpp b/src/services/pipewire/core.cpp index 9c2a3dbf..22445aad 100644 --- a/src/services/pipewire/core.cpp +++ b/src/services/pipewire/core.cpp @@ -14,10 +14,12 @@ #include #include +#include "../../core/logcat.hpp" + namespace qs::service::pipewire { namespace { -Q_LOGGING_CATEGORY(logLoop, "quickshell.service.pipewire.loop", QtWarningMsg); +QS_LOGGING_CATEGORY(logLoop, "quickshell.service.pipewire.loop", QtWarningMsg); } const pw_core_events PwCore::EVENTS = { diff --git a/src/services/pipewire/defaults.cpp b/src/services/pipewire/defaults.cpp index 23252e76..b3d8bfc8 100644 --- a/src/services/pipewire/defaults.cpp +++ b/src/services/pipewire/defaults.cpp @@ -11,6 +11,7 @@ #include #include +#include "../../core/logcat.hpp" #include "../../core/util.hpp" #include "metadata.hpp" #include "node.hpp" @@ -22,7 +23,7 @@ struct spa_json; namespace qs::service::pipewire { namespace { -Q_LOGGING_CATEGORY(logDefaults, "quickshell.service.pipewire.defaults", QtWarningMsg); +QS_LOGGING_CATEGORY(logDefaults, "quickshell.service.pipewire.defaults", QtWarningMsg); } PwDefaultTracker::PwDefaultTracker(PwRegistry* registry): registry(registry) { diff --git a/src/services/pipewire/device.cpp b/src/services/pipewire/device.cpp index 649b9c64..616e7d02 100644 --- a/src/services/pipewire/device.cpp +++ b/src/services/pipewire/device.cpp @@ -20,13 +20,14 @@ #include #include +#include "../../core/logcat.hpp" #include "core.hpp" #include "node.hpp" namespace qs::service::pipewire { namespace { -Q_LOGGING_CATEGORY(logDevice, "quickshell.service.pipewire.device", QtWarningMsg); +QS_LOGGING_CATEGORY(logDevice, "quickshell.service.pipewire.device", QtWarningMsg); } // https://github.com/PipeWire/wireplumber/blob/895c1c7286e8809fad869059179e53ab39c807e9/modules/module-mixer-api.c#L397 diff --git a/src/services/pipewire/link.cpp b/src/services/pipewire/link.cpp index c6421af6..b2549f65 100644 --- a/src/services/pipewire/link.cpp +++ b/src/services/pipewire/link.cpp @@ -10,12 +10,13 @@ #include #include +#include "../../core/logcat.hpp" #include "registry.hpp" namespace qs::service::pipewire { namespace { -Q_LOGGING_CATEGORY(logLink, "quickshell.service.pipewire.link", QtWarningMsg); +QS_LOGGING_CATEGORY(logLink, "quickshell.service.pipewire.link", QtWarningMsg); } QString PwLinkState::toString(Enum value) { diff --git a/src/services/pipewire/metadata.cpp b/src/services/pipewire/metadata.cpp index ea79611a..f2f4ec84 100644 --- a/src/services/pipewire/metadata.cpp +++ b/src/services/pipewire/metadata.cpp @@ -11,12 +11,13 @@ #include #include +#include "../../core/logcat.hpp" #include "registry.hpp" namespace qs::service::pipewire { namespace { -Q_LOGGING_CATEGORY(logMeta, "quickshell.service.pipewire.metadata", QtWarningMsg); +QS_LOGGING_CATEGORY(logMeta, "quickshell.service.pipewire.metadata", QtWarningMsg); } void PwMetadata::bindHooks() { diff --git a/src/services/pipewire/node.cpp b/src/services/pipewire/node.cpp index 3c7af1d3..3e681491 100644 --- a/src/services/pipewire/node.cpp +++ b/src/services/pipewire/node.cpp @@ -25,6 +25,7 @@ #include #include +#include "../../core/logcat.hpp" #include "connection.hpp" #include "core.hpp" #include "device.hpp" @@ -32,7 +33,7 @@ namespace qs::service::pipewire { namespace { -Q_LOGGING_CATEGORY(logNode, "quickshell.service.pipewire.node", QtWarningMsg); +QS_LOGGING_CATEGORY(logNode, "quickshell.service.pipewire.node", QtWarningMsg); } QString PwAudioChannel::toString(Enum value) { diff --git a/src/services/pipewire/registry.cpp b/src/services/pipewire/registry.cpp index d2967d03..c08fc1d9 100644 --- a/src/services/pipewire/registry.cpp +++ b/src/services/pipewire/registry.cpp @@ -15,6 +15,7 @@ #include #include +#include "../../core/logcat.hpp" #include "core.hpp" #include "device.hpp" #include "link.hpp" @@ -23,7 +24,7 @@ namespace qs::service::pipewire { -Q_LOGGING_CATEGORY(logRegistry, "quickshell.service.pipewire.registry", QtWarningMsg); +QS_LOGGING_CATEGORY(logRegistry, "quickshell.service.pipewire.registry", QtWarningMsg); PwBindableObject::~PwBindableObject() { if (this->id != 0) { diff --git a/src/services/pipewire/registry.hpp b/src/services/pipewire/registry.hpp index f1ba9610..14ea4055 100644 --- a/src/services/pipewire/registry.hpp +++ b/src/services/pipewire/registry.hpp @@ -12,12 +12,13 @@ #include #include +#include "../../core/logcat.hpp" #include "../../core/util.hpp" #include "core.hpp" namespace qs::service::pipewire { -Q_DECLARE_LOGGING_CATEGORY(logRegistry); +QS_DECLARE_LOGGING_CATEGORY(logRegistry); class PwRegistry; class PwMetadata; diff --git a/src/services/status_notifier/host.cpp b/src/services/status_notifier/host.cpp index 5fa9af0e..0e4530ac 100644 --- a/src/services/status_notifier/host.cpp +++ b/src/services/status_notifier/host.cpp @@ -12,12 +12,13 @@ #include #include "../../core/common.hpp" +#include "../../core/logcat.hpp" #include "../../dbus/properties.hpp" #include "dbus_watcher_interface.h" #include "item.hpp" #include "watcher.hpp" -Q_LOGGING_CATEGORY(logStatusNotifierHost, "quickshell.service.sni.host", QtWarningMsg); +QS_LOGGING_CATEGORY(logStatusNotifierHost, "quickshell.service.sni.host", QtWarningMsg); namespace qs::service::sni { diff --git a/src/services/status_notifier/host.hpp b/src/services/status_notifier/host.hpp index 9d823e5f..87b3137b 100644 --- a/src/services/status_notifier/host.hpp +++ b/src/services/status_notifier/host.hpp @@ -8,10 +8,11 @@ #include #include +#include "../../core/logcat.hpp" #include "dbus_watcher_interface.h" #include "item.hpp" -Q_DECLARE_LOGGING_CATEGORY(logStatusNotifierHost); +QS_DECLARE_LOGGING_CATEGORY(logStatusNotifierHost); namespace qs::service::sni { diff --git a/src/services/status_notifier/item.cpp b/src/services/status_notifier/item.cpp index c84dfe6c..46329957 100644 --- a/src/services/status_notifier/item.cpp +++ b/src/services/status_notifier/item.cpp @@ -22,6 +22,7 @@ #include "../../core/iconimageprovider.hpp" #include "../../core/imageprovider.hpp" +#include "../../core/logcat.hpp" #include "../../core/platformmenu.hpp" #include "../../dbus/dbusmenu/dbusmenu.hpp" #include "../../dbus/properties.hpp" @@ -34,7 +35,7 @@ using namespace qs::dbus; using namespace qs::dbus::dbusmenu; using namespace qs::menu::platform; -Q_LOGGING_CATEGORY(logStatusNotifierItem, "quickshell.service.sni.item", QtWarningMsg); +QS_LOGGING_CATEGORY(logStatusNotifierItem, "quickshell.service.sni.item", QtWarningMsg); namespace qs::service::sni { diff --git a/src/services/status_notifier/item.hpp b/src/services/status_notifier/item.hpp index 321b73d0..60f3a982 100644 --- a/src/services/status_notifier/item.hpp +++ b/src/services/status_notifier/item.hpp @@ -11,12 +11,13 @@ #include #include "../../core/imageprovider.hpp" +#include "../../core/logcat.hpp" #include "../../dbus/dbusmenu/dbusmenu.hpp" #include "../../dbus/properties.hpp" #include "dbus_item.h" #include "dbus_item_types.hpp" -Q_DECLARE_LOGGING_CATEGORY(logStatusNotifierItem); +QS_DECLARE_LOGGING_CATEGORY(logStatusNotifierItem); namespace qs::service::sni { diff --git a/src/services/status_notifier/watcher.cpp b/src/services/status_notifier/watcher.cpp index 4917077c..e5b841d8 100644 --- a/src/services/status_notifier/watcher.cpp +++ b/src/services/status_notifier/watcher.cpp @@ -10,7 +10,9 @@ #include #include -Q_LOGGING_CATEGORY(logStatusNotifierWatcher, "quickshell.service.sni.watcher", QtWarningMsg); +#include "../../core/logcat.hpp" + +QS_LOGGING_CATEGORY(logStatusNotifierWatcher, "quickshell.service.sni.watcher", QtWarningMsg); namespace qs::service::sni { diff --git a/src/services/status_notifier/watcher.hpp b/src/services/status_notifier/watcher.hpp index 4a042257..4f3c68f3 100644 --- a/src/services/status_notifier/watcher.hpp +++ b/src/services/status_notifier/watcher.hpp @@ -9,7 +9,9 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(logStatusNotifierWatcher); +#include "../../core/logcat.hpp" + +QS_DECLARE_LOGGING_CATEGORY(logStatusNotifierWatcher); namespace qs::service::sni { diff --git a/src/services/upower/core.cpp b/src/services/upower/core.cpp index 9fe0e60c..0f9d9da0 100644 --- a/src/services/upower/core.cpp +++ b/src/services/upower/core.cpp @@ -12,6 +12,7 @@ #include #include +#include "../../core/logcat.hpp" #include "../../core/model.hpp" #include "../../dbus/bus.hpp" #include "../../dbus/properties.hpp" @@ -21,7 +22,7 @@ namespace qs::service::upower { namespace { -Q_LOGGING_CATEGORY(logUPower, "quickshell.service.upower", QtWarningMsg); +QS_LOGGING_CATEGORY(logUPower, "quickshell.service.upower", QtWarningMsg); } UPower::UPower() { diff --git a/src/services/upower/device.cpp b/src/services/upower/device.cpp index b7c61e12..2492b1fc 100644 --- a/src/services/upower/device.cpp +++ b/src/services/upower/device.cpp @@ -8,6 +8,7 @@ #include #include +#include "../../core/logcat.hpp" #include "../../dbus/properties.hpp" #include "dbus_device.h" @@ -16,7 +17,7 @@ using namespace qs::dbus; namespace qs::service::upower { namespace { -Q_LOGGING_CATEGORY(logUPowerDevice, "quickshell.service.upower.device", QtWarningMsg); +QS_LOGGING_CATEGORY(logUPowerDevice, "quickshell.service.upower.device", QtWarningMsg); } QString UPowerDeviceState::toString(UPowerDeviceState::Enum status) { diff --git a/src/services/upower/powerprofiles.cpp b/src/services/upower/powerprofiles.cpp index 4e9ea926..4c407989 100644 --- a/src/services/upower/powerprofiles.cpp +++ b/src/services/upower/powerprofiles.cpp @@ -12,13 +12,14 @@ #include #include +#include "../../core/logcat.hpp" #include "../../dbus/bus.hpp" #include "../../dbus/properties.hpp" namespace qs::service::upower { namespace { -Q_LOGGING_CATEGORY(logPowerProfiles, "quickshell.service.powerprofiles", QtWarningMsg); +QS_LOGGING_CATEGORY(logPowerProfiles, "quickshell.service.powerprofiles", QtWarningMsg); } QString PowerProfile::toString(PowerProfile::Enum profile) { diff --git a/src/wayland/buffer/dmabuf.cpp b/src/wayland/buffer/dmabuf.cpp index d233da50..45933896 100644 --- a/src/wayland/buffer/dmabuf.cpp +++ b/src/wayland/buffer/dmabuf.cpp @@ -36,6 +36,7 @@ #include #include +#include "../../core/logcat.hpp" #include "../../core/stacklist.hpp" #include "manager.hpp" #include "manager_p.hpp" @@ -44,7 +45,7 @@ namespace qs::wayland::buffer::dmabuf { namespace { -Q_LOGGING_CATEGORY(logDmabuf, "quickshell.wayland.buffer.dmabuf", QtWarningMsg); +QS_LOGGING_CATEGORY(logDmabuf, "quickshell.wayland.buffer.dmabuf", QtWarningMsg); LinuxDmabufManager* MANAGER = nullptr; // NOLINT diff --git a/src/wayland/buffer/manager.cpp b/src/wayland/buffer/manager.cpp index 4c2e267e..c7448df8 100644 --- a/src/wayland/buffer/manager.cpp +++ b/src/wayland/buffer/manager.cpp @@ -10,6 +10,7 @@ #include #include +#include "../../core/logcat.hpp" #include "dmabuf.hpp" #include "manager_p.hpp" #include "qsg.hpp" @@ -18,7 +19,7 @@ namespace qs::wayland::buffer { namespace { -Q_LOGGING_CATEGORY(logBuffer, "quickshell.wayland.buffer", QtWarningMsg); +QS_LOGGING_CATEGORY(logBuffer, "quickshell.wayland.buffer", QtWarningMsg); } WlBuffer* WlBufferSwapchain::createBackbuffer(const WlBufferRequest& request, bool* newBuffer) { diff --git a/src/wayland/buffer/shm.cpp b/src/wayland/buffer/shm.cpp index 59a8e914..6a8c6422 100644 --- a/src/wayland/buffer/shm.cpp +++ b/src/wayland/buffer/shm.cpp @@ -13,12 +13,13 @@ #include #include +#include "../../core/logcat.hpp" #include "manager.hpp" namespace qs::wayland::buffer::shm { namespace { -Q_LOGGING_CATEGORY(logShm, "quickshell.wayland.buffer.shm", QtWarningMsg); +QS_LOGGING_CATEGORY(logShm, "quickshell.wayland.buffer.shm", QtWarningMsg); } bool WlShmBuffer::isCompatible(const WlBufferRequest& request) const { diff --git a/src/wayland/hyprland/ipc/connection.cpp b/src/wayland/hyprland/ipc/connection.cpp index 90cb8a21..067b9222 100644 --- a/src/wayland/hyprland/ipc/connection.cpp +++ b/src/wayland/hyprland/ipc/connection.cpp @@ -21,6 +21,7 @@ #include #include +#include "../../../core/logcat.hpp" #include "../../../core/model.hpp" #include "../../../core/qmlscreen.hpp" #include "../../toplevel_management/handle.hpp" @@ -32,8 +33,8 @@ namespace qs::hyprland::ipc { namespace { -Q_LOGGING_CATEGORY(logHyprlandIpc, "quickshell.hyprland.ipc", QtWarningMsg); -Q_LOGGING_CATEGORY(logHyprlandIpcEvents, "quickshell.hyprland.ipc.events", QtWarningMsg); +QS_LOGGING_CATEGORY(logHyprlandIpc, "quickshell.hyprland.ipc", QtWarningMsg); +QS_LOGGING_CATEGORY(logHyprlandIpcEvents, "quickshell.hyprland.ipc.events", QtWarningMsg); } // namespace HyprlandIpc::HyprlandIpc() { diff --git a/src/wayland/screencopy/hyprland_screencopy/hyprland_screencopy.cpp b/src/wayland/screencopy/hyprland_screencopy/hyprland_screencopy.cpp index 457f1055..b8aef961 100644 --- a/src/wayland/screencopy/hyprland_screencopy/hyprland_screencopy.cpp +++ b/src/wayland/screencopy/hyprland_screencopy/hyprland_screencopy.cpp @@ -8,6 +8,7 @@ #include #include +#include "../../../core/logcat.hpp" #include "../../toplevel_management/handle.hpp" #include "../manager.hpp" #include "hyprland_screencopy_p.hpp" @@ -15,7 +16,7 @@ namespace qs::wayland::screencopy::hyprland { namespace { -Q_LOGGING_CATEGORY(logScreencopy, "quickshell.wayland.screencopy.hyprland", QtWarningMsg); +QS_LOGGING_CATEGORY(logScreencopy, "quickshell.wayland.screencopy.hyprland", QtWarningMsg); } HyprlandScreencopyManager::HyprlandScreencopyManager(): QWaylandClientExtensionTemplate(2) { diff --git a/src/wayland/screencopy/image_copy_capture/image_copy_capture.cpp b/src/wayland/screencopy/image_copy_capture/image_copy_capture.cpp index 649b111b..a307d1ee 100644 --- a/src/wayland/screencopy/image_copy_capture/image_copy_capture.cpp +++ b/src/wayland/screencopy/image_copy_capture/image_copy_capture.cpp @@ -13,13 +13,14 @@ #include #include +#include "../../../core/logcat.hpp" #include "../manager.hpp" #include "image_copy_capture_p.hpp" namespace qs::wayland::screencopy::icc { namespace { -Q_LOGGING_CATEGORY(logIcc, "quickshell.wayland.screencopy.icc", QtWarningMsg); +QS_LOGGING_CATEGORY(logIcc, "quickshell.wayland.screencopy.icc", QtWarningMsg); } using IccCaptureSession = QtWayland::ext_image_copy_capture_session_v1; diff --git a/src/wayland/screencopy/wlr_screencopy/wlr_screencopy.cpp b/src/wayland/screencopy/wlr_screencopy/wlr_screencopy.cpp index aa21266b..f4d8c48d 100644 --- a/src/wayland/screencopy/wlr_screencopy/wlr_screencopy.cpp +++ b/src/wayland/screencopy/wlr_screencopy/wlr_screencopy.cpp @@ -12,6 +12,7 @@ #include #include +#include "../../../core/logcat.hpp" #include "../../buffer/manager.hpp" #include "../manager.hpp" #include "wlr_screencopy_p.hpp" @@ -19,7 +20,7 @@ namespace qs::wayland::screencopy::wlr { namespace { -Q_LOGGING_CATEGORY(logScreencopy, "quickshell.wayland.screencopy.wlr", QtWarningMsg); +QS_LOGGING_CATEGORY(logScreencopy, "quickshell.wayland.screencopy.wlr", QtWarningMsg); } WlrScreencopyManager::WlrScreencopyManager(): QWaylandClientExtensionTemplate(3) { diff --git a/src/wayland/toplevel_management/manager.cpp b/src/wayland/toplevel_management/manager.cpp index bd477b49..471d7e20 100644 --- a/src/wayland/toplevel_management/manager.cpp +++ b/src/wayland/toplevel_management/manager.cpp @@ -7,12 +7,13 @@ #include #include +#include "../../core/logcat.hpp" #include "handle.hpp" #include "wayland-wlr-foreign-toplevel-management-unstable-v1-client-protocol.h" namespace qs::wayland::toplevel_management::impl { -Q_LOGGING_CATEGORY(logToplevelManagement, "quickshell.wayland.toplevelManagement", QtWarningMsg); +QS_LOGGING_CATEGORY(logToplevelManagement, "quickshell.wayland.toplevelManagement", QtWarningMsg); ToplevelManager::ToplevelManager(): QWaylandClientExtensionTemplate(3) { this->initialize(); } diff --git a/src/wayland/toplevel_management/manager.hpp b/src/wayland/toplevel_management/manager.hpp index 41848de1..4b906a59 100644 --- a/src/wayland/toplevel_management/manager.hpp +++ b/src/wayland/toplevel_management/manager.hpp @@ -6,13 +6,14 @@ #include #include +#include "../../core/logcat.hpp" #include "wayland-wlr-foreign-toplevel-management-unstable-v1-client-protocol.h" namespace qs::wayland::toplevel_management::impl { class ToplevelHandle; -Q_DECLARE_LOGGING_CATEGORY(logToplevelManagement); +QS_DECLARE_LOGGING_CATEGORY(logToplevelManagement); class ToplevelManager : public QWaylandClientExtensionTemplate diff --git a/src/x11/i3/ipc/connection.cpp b/src/x11/i3/ipc/connection.cpp index cce9ba08..ba010ed3 100644 --- a/src/x11/i3/ipc/connection.cpp +++ b/src/x11/i3/ipc/connection.cpp @@ -22,6 +22,7 @@ #include #include +#include "../../../core/logcat.hpp" #include "../../../core/model.hpp" #include "../../../core/qmlscreen.hpp" #include "connection.hpp" @@ -31,8 +32,8 @@ namespace qs::i3::ipc { namespace { -Q_LOGGING_CATEGORY(logI3Ipc, "quickshell.I3.ipc", QtWarningMsg); -Q_LOGGING_CATEGORY(logI3IpcEvents, "quickshell.I3.ipc.events", QtWarningMsg); +QS_LOGGING_CATEGORY(logI3Ipc, "quickshell.I3.ipc", QtWarningMsg); +QS_LOGGING_CATEGORY(logI3IpcEvents, "quickshell.I3.ipc.events", QtWarningMsg); } // namespace void I3Ipc::makeRequest(const QByteArray& request) {