From 6b6d4e4b0b8a6252c98f2942b8299e0be8d889ff Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 16 Jul 2024 12:22:53 +0200 Subject: [PATCH] Logging: use qCDebug/Warning/Info for categorized logging When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That helper is not defined to take a logging category or category function, so using `qDebug(lcX, ...)` breaks the build. The correct way to emit categorized logging is to use the qCDebug/Warning/Info macros. Task-number: QTBUG-125589 Pick-to: 6.8 6.7 6.5 Change-Id: Ib76a3f2a366a2be27ebc2679be01a883a048347a Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandscreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp index 3faef3f255d..f0ac9fbace6 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland/qwaylandscreen.cpp @@ -346,7 +346,7 @@ void QWaylandScreen::zxdg_output_v1_logical_size(int32_t width, int32_t height) void QWaylandScreen::zxdg_output_v1_done() { if (Q_UNLIKELY(mWaylandDisplay->xdgOutputManager()->version() >= 3)) - qWarning(lcQpaWayland) << "zxdg_output_v1.done received on version 3 or newer, this is most likely a bug in the compositor"; + qCWarning(lcQpaWayland) << "zxdg_output_v1.done received on version 3 or newer, this is most likely a bug in the compositor"; mProcessedEvents |= XdgOutputDoneEvent; if (mInitialized) @@ -358,7 +358,7 @@ void QWaylandScreen::zxdg_output_v1_done() void QWaylandScreen::zxdg_output_v1_name(const QString &name) { if (Q_UNLIKELY(mInitialized)) - qWarning(lcQpaWayland) << "zxdg_output_v1.name received after output has been initialized, this is most likely a bug in the compositor"; + qCWarning(lcQpaWayland) << "zxdg_output_v1.name received after output has been initialized, this is most likely a bug in the compositor"; mOutputName = name; mProcessedEvents |= XdgOutputNameEvent;