summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Henshaw <[email protected]>2016-10-03 15:39:36 +0100
committerOliver Henshaw <[email protected]>2016-10-04 16:57:36 +0100
commit1531c7688315367963527706b3883b7ff91455a5 (patch)
treee8a80fe92328930a5895269c237ca84b362114f6
parentf31736a75c888ba04d8727d12946b99661be0b9c (diff)
parent713b921a7800e7db9e093081d783c24e6f4d7076 (diff)
Improve ksmserver debug output
Summary: Correct misleading debug output. Make all ksmserver output (apart from the tests) controllable with QLoggingCategory. Test Plan: Compiled, logged in and out both with & without "ksmserver.debug=true" in qtlogging.ini Reviewers: davidedmundson Reviewed By: davidedmundson Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2935
-rw-r--r--ksmserver/client.cpp2
-rw-r--r--ksmserver/logout-greeter/CMakeLists.txt2
-rw-r--r--ksmserver/main.cpp7
-rw-r--r--ksmserver/server.cpp16
-rw-r--r--ksmserver/shutdown.cpp18
-rw-r--r--ksmserver/shutdowndlg.cpp6
-rw-r--r--ksmserver/startup.cpp10
-rw-r--r--ksmserver/switchuserdialog.cpp5
8 files changed, 34 insertions, 32 deletions
diff --git a/ksmserver/client.cpp b/ksmserver/client.cpp
index 87a1627..cf06a4e 100644
--- a/ksmserver/client.cpp
+++ b/ksmserver/client.cpp
@@ -89,7 +89,7 @@ char * safeSmsGenerateClientID( SmsConn /*c*/ )
char* ret = NULL;
if (!ret) {
if (my_addr->isEmpty()) {
-// qWarning("Can't get own host name. Your system is severely misconfigured\n");
+// qCWarning(KSMSERVER, "Can't get own host name. Your system is severely misconfigured\n");
/* Faking our IP address, the 0 below is "unknown" address format
(1 would be IP, 2 would be DEC-NET format) */
diff --git a/ksmserver/logout-greeter/CMakeLists.txt b/ksmserver/logout-greeter/CMakeLists.txt
index e9bf062..e4dd4aa 100644
--- a/ksmserver/logout-greeter/CMakeLists.txt
+++ b/ksmserver/logout-greeter/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(KSMSERVER_LOGOUT_GREETER_SRCS main.cpp ../shutdowndlg.cpp)
+set(KSMSERVER_LOGOUT_GREETER_SRCS main.cpp ../shutdowndlg.cpp ../ksmserver_debug.cpp)
add_executable(ksmserver-logout-greeter ${KSMSERVER_LOGOUT_GREETER_SRCS})
target_link_libraries(ksmserver-logout-greeter
PW::KWorkspace
diff --git a/ksmserver/main.cpp b/ksmserver/main.cpp
index eea441f..37a2378 100644
--- a/ksmserver/main.cpp
+++ b/ksmserver/main.cpp
@@ -40,6 +40,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <KSharedConfig>
#include <kmanagerselection.h>
#include <kwindowsystem.h>
+#include <ksmserver_debug.h>
#include "server.h"
#include <QX11Info>
@@ -89,7 +90,7 @@ void checkComposite()
dpy = XOpenDisplay(0); // open default display
if (!dpy)
{
- qCritical() << "Cannot connect to the X server";
+ qCCritical(KSMSERVER) << "Cannot connect to the X server";
return;
}
@@ -288,7 +289,7 @@ extern "C" Q_DECL_EXPORT int kdemain( int argc, char* argv[] )
// registerService( QStringLiteral( "org.kde.ksmserver" ),
// QDBusConnectionInterface::DontQueueService ) )
// {
-// qWarning("Could not register with D-BUS. Aborting.");
+// qCWarning(KSMSERVER, "Could not register with D-BUS. Aborting.");
// return 1;
// }
@@ -301,7 +302,7 @@ extern "C" Q_DECL_EXPORT int kdemain( int argc, char* argv[] )
* does nothing on this platform, as here the default is reversed)
*/
if (!only_local) {
- qWarning("--nolocal is not supported on your platform. Sorry.");
+ qCWarning(KSMSERVER, "--nolocal is not supported on your platform. Sorry.");
}
only_local = false;
#endif
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 89a820e..98e41db 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -457,7 +457,7 @@ Status SetAuthentication (int count, IceListenObj *listenObjs,
QString iceAuth = QStandardPaths::findExecutable(QStringLiteral("iceauth"));
if (iceAuth.isEmpty())
{
- qWarning("KSMServer: could not find iceauth");
+ qCWarning(KSMSERVER, "KSMServer: could not find iceauth");
return 0;
}
@@ -487,7 +487,7 @@ void FreeAuthenticationData(int count, IceAuthDataEntry *authDataEntries)
QString iceAuth = QStandardPaths::findExecutable(QStringLiteral("iceauth"));
if (iceAuth.isEmpty())
{
- qWarning("KSMServer: could not find iceauth");
+ qCWarning(KSMSERVER, "KSMServer: could not find iceauth");
return;
}
@@ -504,7 +504,7 @@ void FreeAuthenticationData(int count, IceAuthDataEntry *authDataEntries)
static int Xio_ErrorHandler( Display * )
{
- qWarning("ksmserver: Fatal IO error: client killed");
+ qCWarning(KSMSERVER, "ksmserver: Fatal IO error: client killed");
// Don't do anything that might require the X connection
if (the_server)
@@ -650,14 +650,14 @@ KSMServer::KSMServer( const QString& windowManager, InitFlags flags )
(SmPointer) this,
HostBasedAuthProc, 256, errormsg ) ) {
- qWarning("KSMServer: could not register XSM protocol");
+ qCWarning(KSMSERVER, "KSMServer: could not register XSM protocol");
}
if (!IceListenForConnections (&numTransports, &listenObjs,
256, errormsg))
{
- qWarning("KSMServer: Error listening for connections: %s", errormsg);
- qWarning("KSMServer: Aborting.");
+ qCWarning(KSMSERVER, "KSMServer: Error listening for connections: %s", errormsg);
+ qCWarning(KSMSERVER, "KSMServer: Aborting.");
exit(1);
}
@@ -681,8 +681,8 @@ KSMServer::KSMServer( const QString& windowManager, InitFlags flags )
f = ::fopen(fName.data(), "w+");
if (!f)
{
- qWarning("KSMServer: cannot open %s: %s", fName.data(), strerror(errno));
- qWarning("KSMServer: Aborting.");
+ qCWarning(KSMSERVER, "KSMServer: cannot open %s: %s", fName.data(), strerror(errno));
+ qCWarning(KSMSERVER, "KSMServer: Aborting.");
exit(1);
}
char* session_manager = IceComposeNetworkIdList(numTransports, listenObjs);
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 60eb672..a44deb0 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -129,7 +129,7 @@ bool readFromPipe(int pipe)
void KSMServer::shutdown( KWorkSpace::ShutdownConfirm confirm,
KWorkSpace::ShutdownType sdtype, KWorkSpace::ShutdownMode sdmode )
{
- qDebug() << "Shutdown called with confirm " << confirm
+ qCDebug(KSMSERVER) << "Shutdown called with confirm " << confirm
<< " type " << sdtype << " and mode " << sdmode;
pendingShutdown.stop();
if( dialogActive )
@@ -176,7 +176,7 @@ void KSMServer::shutdown( KWorkSpace::ShutdownConfirm confirm,
if (sdmode == KWorkSpace::ShutdownModeDefault)
sdmode = KWorkSpace::ShutdownModeInteractive;
- qDebug() << "After modifications confirm is " << confirm
+ qCDebug(KSMSERVER) << "After modifications confirm is " << confirm
<< " type is " << sdtype << " and mode " << sdmode;
QString bopt;
if ( !logoutConfirmed ) {
@@ -270,7 +270,7 @@ void KSMServer::performLogout()
QStringLiteral( "restorePreviousLogout" ) )
== QStringLiteral( "restorePreviousLogout" ) );
- qDebug() << "saveSession is " << saveSession;
+ qCDebug(KSMSERVER) << "saveSession is " << saveSession;
if ( saveSession )
sessionGroup = QStringLiteral( "Session: " ) + QString::fromLocal8Bit( SESSION_PREVIOUS_LOGOUT );
@@ -317,7 +317,7 @@ void KSMServer::performLogout()
SmsSaveYourself( c->connection(), saveType,
true, SmInteractStyleAny, false );
}
- qDebug() << "clients should be empty, " << clients.isEmpty();
+ qCDebug(KSMSERVER) << "clients should be empty, " << clients.isEmpty();
if ( clients.isEmpty() )
completeShutdownOrCheckpoint();
dialogActive = false;
@@ -532,7 +532,7 @@ void KSMServer::protectionTimeout()
void KSMServer::completeShutdownOrCheckpoint()
{
- qDebug() << "completeShutdownOrCheckpoint called";
+ qCDebug(KSMSERVER) << "completeShutdownOrCheckpoint called";
if ( state != Shutdown && state != Checkpoint && state != ClosingSubSession )
return;
@@ -564,7 +564,7 @@ void KSMServer::completeShutdownOrCheckpoint()
else
discardSession();
- qDebug() << "state is " << state;
+ qCDebug(KSMSERVER) << "state is " << state;
if ( state == Shutdown ) {
KNotification *n = KNotification::event(QStringLiteral("exitkde"), QString(), QPixmap(), 0l, KNotification::DefaultEvent); // Plasma says good bye
connect(n, &KNotification::closed, this, &KSMServer::startKilling);
@@ -605,7 +605,7 @@ void KSMServer::startKilling()
foreach( KSMClient* c, clients ) {
if( isWM( c )) // kill the WM as the last one in order to reduce flicker
continue;
- qCDebug(KSMSERVER) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")";
+ qCDebug(KSMSERVER) << "startKilling: client " << c->program() << "(" << c->clientId() << ")";
SmsDie( c->connection() );
}
@@ -675,7 +675,7 @@ void KSMServer::killingCompleted()
void KSMServer::timeoutQuit()
{
foreach( KSMClient* c, clients ) {
- qWarning() << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ;
+ qCWarning(KSMSERVER) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" ;
}
killWM();
}
@@ -683,7 +683,7 @@ void KSMServer::timeoutQuit()
void KSMServer::timeoutWMQuit()
{
if( state == KillingWM ) {
- qWarning() << "SmsDie WM timeout" ;
+ qCWarning(KSMSERVER) << "SmsDie WM timeout" ;
}
killingCompleted();
}
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp
index 3fd9a12..c393e33 100644
--- a/ksmserver/shutdowndlg.cpp
+++ b/ksmserver/shutdowndlg.cpp
@@ -24,7 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
#include "shutdowndlg.h"
-//include <ksmserver_debug.h>
+#include "ksmserver_debug.h"
#include <QApplication>
#include <QDesktopWidget>
@@ -172,12 +172,12 @@ void KSMShutdownDlg::init()
//qCDebug(KSMSERVER) << "Using QML theme" << fileName;
setSource(QUrl::fromLocalFile(fileName));
} else {
- qWarning() << "Couldn't find a theme for the Shutdown dialog" << fileName;
+ qCWarning(KSMSERVER) << "Couldn't find a theme for the Shutdown dialog" << fileName;
return;
}
if(!errors().isEmpty()) {
- qWarning() << errors();
+ qCWarning(KSMSERVER) << errors();
}
connect(rootObject(), SIGNAL(logoutRequested()), SLOT(slotLogout()));
diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp
index 6136763..5031516 100644
--- a/ksmserver/startup.cpp
+++ b/ksmserver/startup.cpp
@@ -110,7 +110,7 @@ class NotificationThread : public QThread
QString soundFilename = notifyConfig.readEntry(QStringLiteral("Sound"));
if (soundFilename.isEmpty()) {
- qWarning() << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification";
+ qCWarning(KSMSERVER) << "Audio notification requested, but no sound file provided in notifyrc file, aborting audio notification";
return;
}
@@ -119,7 +119,7 @@ class NotificationThread : public QThread
soundURL = QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("sounds/") + soundFilename));
if (soundURL.isEmpty()) {
- qWarning() << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification";
+ qCWarning(KSMSERVER) << "Audio notification requested, but sound file from notifyrc file was not found, aborting audio notification";
return;
}
}
@@ -222,7 +222,7 @@ void KSMServer::wmProcessChange()
}
if( wmProcess->state() == QProcess::NotRunning )
{ // wm failed to launch for some reason, go with kwin instead
- qWarning() << "Window manager" << wm << "failed to launch";
+ qCWarning(KSMSERVER) << "Window manager" << wm << "failed to launch";
if( wm == QStringLiteral( KWIN_BIN ) )
return; // uhoh, kwin itself failed
qCDebug(KSMSERVER) << "Launching KWin";
@@ -265,7 +265,7 @@ void KSMServer::autoStart0Done()
QStringLiteral( "org.kde.KCMInit" ),
QDBusConnection::sessionBus(), this );
if( !kcminitSignals->isValid()) {
- qWarning() << "kcminit not running? If we are running with mobile profile or in another platform other than X11 this is normal.";
+ qCWarning(KSMSERVER) << "kcminit not running? If we are running with mobile profile or in another platform other than X11 this is normal.";
delete kcminitSignals;
kcminitSignals = 0;
QTimer::singleShot(0, this, &KSMServer::kcmPhase1Done);
@@ -611,7 +611,7 @@ void KSMServer::resumeStartupInternal()
autoStart2();
break;
default:
- qWarning() << "Unknown resume startup state" ;
+ qCWarning(KSMSERVER) << "Unknown resume startup state" ;
break;
}
}
diff --git a/ksmserver/switchuserdialog.cpp b/ksmserver/switchuserdialog.cpp
index 26d6710..f4f6436 100644
--- a/ksmserver/switchuserdialog.cpp
+++ b/ksmserver/switchuserdialog.cpp
@@ -21,6 +21,7 @@
#include "switchuserdialog.h"
#include <kdisplaymanager.h>
+#include <ksmserver_debug.h>
#include <QApplication>
#include <QDebug>
@@ -91,7 +92,7 @@ KSMSwitchUserDialog::KSMSwitchUserDialog(KDisplayManager *dm, QWindow *parent)
if (QFile::exists(fileName)) {
setSource(QUrl::fromLocalFile(fileName));
} else {
- qWarning() << "Couldn't find a theme for the Switch User dialog" << fileName;
+ qCWarning(KSMSERVER) << "Couldn't find a theme for the Switch User dialog" << fileName;
return;
}
@@ -99,7 +100,7 @@ KSMSwitchUserDialog::KSMSwitchUserDialog(KDisplayManager *dm, QWindow *parent)
screen()->virtualGeometry().center().y() - height() / 2);
if (!errors().isEmpty()) {
- qWarning() << errors();
+ qCWarning(KSMSERVER) << errors();
}
connect(rootObject(), SIGNAL(dismissed()), this, SIGNAL(dismissed()));