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 <davidedmundson@kde.org>
This commit is contained in:
Volker Hilsheimer 2024-07-16 12:22:53 +02:00
parent 9a5054cb62
commit 6b6d4e4b0b

View File

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