change logging

This commit is contained in:
Patrick von Reth 2015-04-18 12:29:46 +02:00
parent d3b38a7a48
commit 954d4fb1ce
2 changed files with 6 additions and 5 deletions

View File

@ -33,17 +33,17 @@ enum SnoreDebugLevels {
/** /**
* The most important messages, will be diplayed if the debug level >= 1 * The most important messages, will be diplayed if the debug level >= 1
*/ */
SNORE_WARNING = 1, SNORE_WARNING = 0,
/** /**
* Information messages, will be diplayed if the debug level >= 2 * Information messages, will be diplayed if the debug level >= 2
*/ */
SNORE_INFO = 2, SNORE_INFO = 1,
/** /**
* Debug messages will be diplayed if the debug level >= 3 * Debug messages will be diplayed if the debug level >= 3
*/ */
SNORE_DEBUG = 3 SNORE_DEBUG = 2
}; };
@ -53,7 +53,7 @@ enum SnoreDebugLevels {
*/ */
#if !defined(QT_NO_DEBUG_OUTPUT) #if !defined(QT_NO_DEBUG_OUTPUT)
#define snoreDebug(X) Snore::SnoreLog( X ) << Q_FUNC_INFO #define snoreDebug(X) Snore::SnoreLog( X ) << #X << Q_FUNC_INFO
#else #else
#define snoreDebug(X) QNoDebug() #define snoreDebug(X) QNoDebug()
#endif #endif

View File

@ -32,8 +32,9 @@ using namespace Snore;
SnorePlugin::SnorePlugin(const QString &name) : SnorePlugin::SnorePlugin(const QString &name) :
m_name(name) m_name(name)
{ {
Q_ASSERT_X(thread() != qApp->thread(),Q_FUNC_INFO,"Plugin initialized in wrong thread");
if (thread() != qApp->thread()) { if (thread() != qApp->thread()) {
moveToThread(qApp->thread()); snoreDebug(SNORE_WARNING) << "Plugin initialized in wrong thread.";
} }
setDefaultValue("Enabled", false, LOCAL_SETTING); setDefaultValue("Enabled", false, LOCAL_SETTING);
} }