refs #359, fixed loghandler, removed / fine tuning of some output / log messages

see also discussion in #359
This commit is contained in:
Klaus Basan
2014-12-15 23:19:52 +01:00
parent 0ea26f1ce9
commit f62f85b263
6 changed files with 13 additions and 16 deletions

View File

@@ -100,8 +100,7 @@ namespace BlackGui
bool hasData = this->countBookedStations() > 0 || this->countOnlineStations() > 0;
if (hasData && !this->isVisibleWidget())
{
// KWB remove: qDebug() will be removed soon
qDebug() << this->objectName() << "Skipping update, not visible";
// Update skipped, as not visible
return;
}

View File

@@ -60,8 +60,7 @@ namespace BlackGui
bool withData = countUsers() > 0 || countClients() > 0;
if (withData && !isVisibleWidget())
{
// KWB remove: qDebug() will be removed soo
qDebug() << this->objectName() << "Skipping update";
// Skip update, invisible
return;
}

View File

@@ -168,6 +168,7 @@ namespace BlackMisc
if (m_handler)
{
if (! m_inheritFallThrough) { m_handler->inheritConsoleOutput(); }
m_handler->disconnect(this);
}
}

View File

@@ -167,6 +167,7 @@ namespace BlackMisc
bool canBeDeleted()
{
if (! m_inheritFallThrough) { return false; }
static const auto signal = QMetaMethod::fromSignal(&CLogPatternHandler::messageLogged);
return ! isSignalConnected(signal);
}

View File

@@ -39,9 +39,7 @@ int main(int argc, char *argv[])
QTextStream cin(stdin);
QTextStream cout(stdout);
cout << BlackMisc::CProject::version();
cout << BlackMisc::CProject::compiledInfo();
cout << endl;
cout << BlackMisc::CProject::version() << " " << BlackMisc::CProject::compiledInfo() << endl;
cout << "1 + la/ra .. session DBus server (default)" << endl;
cout << "2 + la/ra .. system DBus server" << endl;
@@ -78,7 +76,7 @@ int main(int argc, char *argv[])
// tool to allow input indepent from event loop
QtConcurrent::run(BlackMiscTest::Tool::serverLoop, core); // QFuture<void> future
cout << "Server event loop, pid:" << BlackMiscTest::Tool::getPid() << "Thread id:" << QThread::currentThreadId();
cout << "Server event loop, pid: " << BlackMiscTest::Tool::getPid() << " Thread id: " << QThread::currentThreadId() << endl;
// end
return a.exec();

View File

@@ -46,14 +46,13 @@ int main(int argc, char *argv[])
// application
QApplication a(argc, argv);
CLogHandler::instance()->install();
CLogHandler::instance()->enableConsoleOutput(false);
// CLogHandler::instance()->handlerForPattern(
// CLogPattern::anyOf({ CLogCategory::contextSlot(), CLogCategory::context() })
// )->enableConsoleOutput(false);
// CLogHandler::instance()->handlerForPattern(
// CLogPattern::anyOf({ CLogCategory::contextSlot(), CLogCategory::context() }).withSeverityAtOrAbove(CStatusMessage::SeverityInfo)
// )->enableConsoleOutput(true);
CLogHandler::instance()->enableConsoleOutput(true);
CLogHandler::instance()->handlerForPattern(
CLogPattern::anyOf({ CLogCategory::contextSlot(), CLogCategory::context() })
)->enableConsoleOutput(false);
CLogHandler::instance()->handlerForPattern(
CLogPattern::anyOf({ CLogCategory::contextSlot(), CLogCategory::context() }).withSeverityAtOrAbove(CStatusMessage::SeverityInfo)
)->enableConsoleOutput(true);
// Translations
QFile file(":blackmisc/translations/blackmisc_i18n_de.qm");