Use debug logging categories

This commit is contained in:
Aleix Pol 2021-04-01 17:55:03 +02:00
parent be966dbeb6
commit cffdab8c33
3 changed files with 12 additions and 13 deletions

View file

@ -6,6 +6,15 @@ ecm_add_qtwayland_client_protocol(LAYER_SHELL_SOURCES PROTOCOL wlr-layer-shell-u
add_library(layer-shell SHARED qwaylandlayershellintegrationplugin.cpp)
target_link_libraries(layer-shell LayerShellQtInterface Qt5::WaylandClient Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate)
ecm_qt_declare_logging_category(LAYER_SHELL_SOURCES
HEADER
layershellqt_logging.h
IDENTIFIER
LAYERSHELLQT
CATEGORY_NAME
layershellqt
)
add_library(LayerShellQtInterface SHARED qwaylandlayersurface.cpp interfaces/window.cpp interfaces/shell.cpp qwaylandlayershellintegration.cpp qwaylandlayershell.cpp ${LAYER_SHELL_SOURCES})
target_link_libraries(LayerShellQtInterface PRIVATE Qt5::Gui Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate Wayland::Client)
target_include_directories(LayerShellQtInterface PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/LayerShellQt>"

View file

@ -5,9 +5,9 @@
*/
#include "window.h"
#include <QDebug>
#include <private/qwaylandwindow_p.h>
#include <private/qwaylandshellsurface_p.h>
#include <layershellqt_logging.h>
#include "../qwaylandlayersurface_p.h"
using namespace LayerShellQt;
@ -53,12 +53,12 @@ Window *Window::get(QWindow *window)
{
auto ww = dynamic_cast<QtWaylandClient::QWaylandWindow *>(window->handle());
if (!ww) {
qDebug() << "window not a wayland window" << window;
qCDebug(LAYERSHELLQT) << "window not a wayland window" << window;
return nullptr;
}
QWaylandLayerSurface* s = qobject_cast<QWaylandLayerSurface *>(ww->shellSurface());
if (!s) {
qDebug() << "window not using wlr-layer-shell" << window << ww->shellSurface();
qCDebug(LAYERSHELLQT) << "window not using wlr-layer-shell" << window << ww->shellSurface();
return nullptr;
}