logging update

use QLoggingCategory now to provides improved logging
This commit is contained in:
Skycoder42
2016-02-08 12:57:35 +01:00
parent 04ce9f6a9c
commit c53a5dbcbe
8 changed files with 116 additions and 99 deletions
+7 -5
View File
@@ -30,8 +30,8 @@ private:
HotkeyErrorHandler();
~HotkeyErrorHandler();
static bool hasError;//TODO threading
static QString errorString;//TODO threading
static bool hasError;
static QString errorString;
private:
XErrorHandler prevHandler;
@@ -108,7 +108,8 @@ bool QHotkeyPrivateX11::registerShortcut(QHotkey::NativeShortcut shortcut)
}
if(errorHandler.hasError) {
qWarning() << "QHotkey: Failed to register hotkey. Error:" << qPrintable(errorHandler.errorString);
qCWarning(logQHotkey) << "[QHotkey] Failed to register hotkey. Error:"
<< qPrintable(errorHandler.errorString);
this->unregisterShortcut(shortcut);
return false;
} else
@@ -129,8 +130,9 @@ bool QHotkeyPrivateX11::unregisterShortcut(QHotkey::NativeShortcut shortcut)
DefaultRootWindow(display));
}
if(errorHandler.hasError) {
qWarning() << "QHotkey: Failed to unregister hotkey. Error:" << qPrintable(errorHandler.errorString);
if(errorHandler.hasError) {
qCWarning(logQHotkey) << "Failed to unregister hotkey. Error:"
<< qPrintable(errorHandler.errorString);
this->unregisterShortcut(shortcut);
return false;
} else