core/log: track default logging categories

Fixes a bug in fb37be7 which ignored default logging categories due to
skipping QLoggingRegistry's filter.
This commit is contained in:
outfoxxed 2025-07-08 13:39:34 -07:00
parent 5d7e07508a
commit 3d594e16dd
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
68 changed files with 212 additions and 79 deletions

View file

@ -12,13 +12,14 @@
#include <qstringliteral.h>
#include <qtypes.h>
#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) {

View file

@ -8,6 +8,7 @@
#include <qobject.h>
#include <qtmetamacros.h>
#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

View file

@ -50,13 +50,21 @@ private:
ObjectModel<BluetoothDevice> 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<qs::bluetooth::BluetoothAdapter>*);
@ -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();

View file

@ -12,6 +12,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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) {

View file

@ -18,8 +18,10 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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)

View file

@ -17,10 +17,11 @@
#include <ranges>
#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 {

View file

@ -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<const QQmlEngine*, EngineGeneration*> g_generations; // NOLINT

View file

@ -1,11 +1,12 @@
#include "incubator.hpp"
#include <qlogging.h>
#include <qloggingcategory.h>
#include <qqmlincubator.h>
#include <qtmetamacros.h>
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) {

View file

@ -1,11 +1,12 @@
#pragma once
#include <qloggingcategory.h>
#include <qobject.h>
#include <qqmlincubator.h>
#include <qtmetamacros.h>
Q_DECLARE_LOGGING_CATEGORY(logIncubator);
#include "logcat.hpp"
QS_DECLARE_LOGGING_CATEGORY(logIncubator);
class QsQmlIncubator
: public QObject

28
src/core/logcat.hpp Normal file
View file

@ -0,0 +1,28 @@
#pragma once
#include <qlogging.h>
#include <qloggingcategory.h>
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) (); \
}

View file

@ -30,17 +30,18 @@
#include <sys/sendfile.h>
#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,

View file

@ -2,6 +2,7 @@
#include <utility>
#include <qbytearrayview.h>
#include <qcontainerfwd.h>
#include <qdatetime.h>
#include <qfile.h>
@ -12,7 +13,9 @@
#include <qobject.h>
#include <qtmetamacros.h>
Q_DECLARE_LOGGING_CATEGORY(logBare);
#include "logcat.hpp"
QS_DECLARE_LOGGING_CATEGORY(logBare);
namespace qs::log {
@ -127,11 +130,14 @@ private:
QString mRulesString;
QList<qt_logging_registry::QLoggingRule>* rules = nullptr;
QtMsgType mDefaultLevel = QtWarningMsg;
QHash<QLatin1StringView, QtMsgType> defaultLevels;
QHash<const void*, CategoryFilter> sparseFilters;
QHash<QLatin1StringView, CategoryFilter> allFilters;
QTextStream stdoutStream;
LoggingThreadProxy threadProxy;
friend void initLogCategoryLevel(const char* name, QtMsgType defaultLevel);
};
bool readEncodedLogs(

View file

@ -16,10 +16,11 @@
#include <qstringview.h>
#include <qtypes.h>
#include "logcat.hpp"
#include "logging_qtprivate.hpp"
namespace qs::log {
Q_DECLARE_LOGGING_CATEGORY(logLogging);
QS_DECLARE_LOGGING_CATEGORY(logLogging);
namespace qt_logging_registry {

View file

@ -12,8 +12,10 @@
#include <qstringview.h>
#include <qtypes.h>
#include "logcat.hpp"
namespace qs::log {
Q_DECLARE_LOGGING_CATEGORY(logLogging);
QS_DECLARE_LOGGING_CATEGORY(logLogging);
namespace qt_logging_registry {

View file

@ -16,9 +16,10 @@
#include <unistd.h>
#include "instanceinfo.hpp"
#include "logcat.hpp"
namespace {
Q_LOGGING_CATEGORY(logPaths, "quickshell.paths", QtWarningMsg);
QS_LOGGING_CATEGORY(logPaths, "quickshell.paths");
}
QsPaths* QsPaths::instance() {

View file

@ -14,7 +14,9 @@
#include <qtypes.h>
#include <qurl.h>
Q_LOGGING_CATEGORY(logQsIntercept, "quickshell.interceptor", QtWarningMsg);
#include "logcat.hpp"
QS_LOGGING_CATEGORY(logQsIntercept, "quickshell.interceptor", QtWarningMsg);
QUrl QsUrlInterceptor::intercept(
const QUrl& originalUrl,

View file

@ -10,7 +10,9 @@
#include <qqmlnetworkaccessmanagerfactory.h>
#include <qurl.h>
Q_DECLARE_LOGGING_CATEGORY(logQsIntercept);
#include "logcat.hpp"
QS_DECLARE_LOGGING_CATEGORY(logQsIntercept);
class QsUrlInterceptor: public QQmlAbstractUrlInterceptor {
public:

View file

@ -15,7 +15,9 @@
#include <qstringliteral.h>
#include <qtextstream.h>
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;

View file

@ -6,7 +6,9 @@
#include <qloggingcategory.h>
#include <qvector.h>
Q_DECLARE_LOGGING_CATEGORY(logQmlScanner);
#include "logcat.hpp"
QS_DECLARE_LOGGING_CATEGORY(logQmlScanner);
// expects canonical paths
class QmlScanner {

View file

@ -15,6 +15,7 @@
#include <unistd.h>
#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 {

View file

@ -17,6 +17,7 @@
#include <sys/types.h>
#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;

View file

@ -12,10 +12,12 @@
#include <qtypes.h>
#include <qvariant.h>
#include "../core/logcat.hpp"
namespace qs::dbus {
namespace {
Q_LOGGING_CATEGORY(logDbus, "quickshell.dbus", QtWarningMsg);
QS_LOGGING_CATEGORY(logDbus, "quickshell.dbus", QtWarningMsg);
}
void tryLaunchService(

View file

@ -21,13 +21,14 @@
#include <qvariant.h>
#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;

View file

@ -20,7 +20,7 @@
#include "../properties.hpp"
#include "dbus_menu_types.hpp"
Q_DECLARE_LOGGING_CATEGORY(logDbusMenu);
QS_DECLARE_LOGGING_CATEGORY(logDbusMenu);
class DBusMenuInterface;

View file

@ -9,11 +9,12 @@
#include <qloggingcategory.h>
#include <qtmetamacros.h>
#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 {

View file

@ -20,9 +20,10 @@
#include <qtversionchecks.h>
#include <qvariant.h>
#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 {

View file

@ -23,11 +23,12 @@
#include <qtversionchecks.h>
#include <qvariant.h>
#include "../core/logcat.hpp"
#include "../core/util.hpp"
class DBusPropertiesInterface;
Q_DECLARE_LOGGING_CATEGORY(logDbusProperties);
QS_DECLARE_LOGGING_CATEGORY(logDbusProperties);
namespace qs::dbus {

View file

@ -11,10 +11,12 @@
#include <qquickwindow.h>
#include <qstringliteral.h>
#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);

View file

@ -20,12 +20,13 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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) {

View file

@ -11,9 +11,10 @@
#include <qqmlengine.h>
#include <qtmetamacros.h>
#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();

View file

@ -10,10 +10,11 @@
#include <qtclasshelpermacros.h>
#include <qtmetamacros.h>
#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 {

View file

@ -10,12 +10,13 @@
#include <qobject.h>
#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);

View file

@ -15,6 +15,8 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#include "../core/logcat.hpp"
template <typename... Types>
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 <typename T>
class MessageStream {

View file

@ -14,9 +14,10 @@
#include <qtypes.h>
#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) {

View file

@ -14,6 +14,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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) {

View file

@ -9,13 +9,14 @@
#include <qobject.h>
#include <qqmllist.h>
#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() {

View file

@ -7,10 +7,12 @@
#include <qsysinfo.h>
#include <qtypes.h>
#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;

View file

@ -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) {

View file

@ -12,6 +12,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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<DBusNotificationImage>();

View file

@ -8,9 +8,10 @@
#include <qtmetamacros.h>
#include <sys/wait.h>
#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) {

View file

@ -8,9 +8,10 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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).

View file

@ -14,10 +14,12 @@
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#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 = {

View file

@ -11,6 +11,7 @@
#include <qtmetamacros.h>
#include <spa/utils/json.h>
#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) {

View file

@ -20,13 +20,14 @@
#include <spa/pod/vararg.h>
#include <spa/utils/type.h>
#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

View file

@ -10,12 +10,13 @@
#include <qtypes.h>
#include <spa/utils/dict.h>
#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) {

View file

@ -11,12 +11,13 @@
#include <qtypes.h>
#include <spa/utils/dict.h>
#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() {

View file

@ -25,6 +25,7 @@
#include <spa/utils/keys.h>
#include <spa/utils/type.h>
#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) {

View file

@ -15,6 +15,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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) {

View file

@ -12,12 +12,13 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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;

View file

@ -12,12 +12,13 @@
#include <unistd.h>
#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 {

View file

@ -8,10 +8,11 @@
#include <qobject.h>
#include <qtmetamacros.h>
#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 {

View file

@ -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 {

View file

@ -11,12 +11,13 @@
#include <qtypes.h>
#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 {

View file

@ -10,7 +10,9 @@
#include <qobject.h>
#include <qtmetamacros.h>
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 {

View file

@ -9,7 +9,9 @@
#include <qtmetamacros.h>
#include <qtypes.h>
Q_DECLARE_LOGGING_CATEGORY(logStatusNotifierWatcher);
#include "../../core/logcat.hpp"
QS_DECLARE_LOGGING_CATEGORY(logStatusNotifierWatcher);
namespace qs::service::sni {

View file

@ -12,6 +12,7 @@
#include <qobject.h>
#include <qqmllist.h>
#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() {

View file

@ -8,6 +8,7 @@
#include <qstring.h>
#include <qtypes.h>
#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) {

View file

@ -12,13 +12,14 @@
#include <qobject.h>
#include <qstringliteral.h>
#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) {

View file

@ -36,6 +36,7 @@
#include <wayland-util.h>
#include <xf86drm.h>
#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

View file

@ -10,6 +10,7 @@
#include <qtmetamacros.h>
#include <qvectornd.h>
#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) {

View file

@ -13,12 +13,13 @@
#include <qsize.h>
#include <wayland-client-protocol.h>
#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 {

View file

@ -21,6 +21,7 @@
#include <qtypes.h>
#include <qvariant.h>
#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() {

View file

@ -8,6 +8,7 @@
#include <qwaylandclientextension.h>
#include <wayland-hyprland-toplevel-export-v1-client-protocol.h>
#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) {

View file

@ -13,13 +13,14 @@
#include <wayland-ext-image-copy-capture-v1-client-protocol.h>
#include <wayland-util.h>
#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;

View file

@ -12,6 +12,7 @@
#include <qwaylandclientextension.h>
#include <wayland-wlr-screencopy-unstable-v1-client-protocol.h>
#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) {

View file

@ -7,12 +7,13 @@
#include <qtmetamacros.h>
#include <qwaylandclientextension.h>
#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(); }

View file

@ -6,13 +6,14 @@
#include <qwayland-wlr-foreign-toplevel-management-unstable-v1.h>
#include <qwaylandclientextension.h>
#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<ToplevelManager>

View file

@ -22,6 +22,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#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) {