Introduce categorized logging
New logging categories KWAYLAND_SERVER and KWAYLAND_CLIENT.
This commit is contained in:
parent
6f755bf680
commit
1d5a032803
4 changed files with 50 additions and 2 deletions
|
@ -9,6 +9,7 @@ set(SERVER_LIB_SRCS
|
|||
display.cpp
|
||||
global.cpp
|
||||
keyboard_interface.cpp
|
||||
logging.cpp
|
||||
output_interface.cpp
|
||||
pointer_interface.cpp
|
||||
region_interface.cpp
|
||||
|
|
|
@ -20,6 +20,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "display.h"
|
||||
#include "compositor_interface.h"
|
||||
#include "datadevicemanager_interface.h"
|
||||
#include "logging_p.h"
|
||||
#include "output_interface.h"
|
||||
#include "seat_interface.h"
|
||||
#include "shell_interface.h"
|
||||
|
@ -68,7 +69,7 @@ void Display::Private::installSocketNotifier()
|
|||
}
|
||||
int fd = wl_event_loop_get_fd(loop);
|
||||
if (fd == -1) {
|
||||
qWarning() << "Did not get the file descriptor for the event loop";
|
||||
qCWarning(KWAYLAND_SERVER) << "Did not get the file descriptor for the event loop";
|
||||
return;
|
||||
}
|
||||
QSocketNotifier *m_notifier = new QSocketNotifier(fd, QSocketNotifier::Read, q);
|
||||
|
@ -94,7 +95,7 @@ void Display::Private::flush()
|
|||
return;
|
||||
}
|
||||
if (wl_event_loop_dispatch(loop, 0) != 0) {
|
||||
qWarning() << "Error on dispatching Wayland event loop";
|
||||
qCWarning(KWAYLAND_SERVER) << "Error on dispatching Wayland event loop";
|
||||
}
|
||||
wl_display_flush_clients(display);
|
||||
}
|
||||
|
|
21
src/wayland/server/logging.cpp
Normal file
21
src/wayland/server/logging.cpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
/********************************************************************
|
||||
Copyright 2015 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) version 3, or any
|
||||
later version accepted by the membership of KDE e.V. (or its
|
||||
successor approved by the membership of KDE e.V.), which shall
|
||||
act as a proxy defined in Section 6 of version 3 of the license.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#include "logging_p.h"
|
||||
Q_LOGGING_CATEGORY(KWAYLAND_SERVER, "kwayland-server");
|
25
src/wayland/server/logging_p.h
Normal file
25
src/wayland/server/logging_p.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/********************************************************************
|
||||
Copyright 2015 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) version 3, or any
|
||||
later version accepted by the membership of KDE e.V. (or its
|
||||
successor approved by the membership of KDE e.V.), which shall
|
||||
act as a proxy defined in Section 6 of version 3 of the license.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#ifndef KWAYALND_SERVER_LOGGING_P_H
|
||||
#define KWAYALND_SERVER_LOGGING_P_H
|
||||
#include <QLoggingCategory>
|
||||
Q_DECLARE_LOGGING_CATEGORY(KWAYLAND_SERVER)
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue