refs #338 Using CLogPattern for subscribing to log messages and selectively enabling console output.

This commit is contained in:
Mathew Sutcliffe
2014-10-22 02:57:07 +01:00
parent 7f783fac8f
commit 8962368278
3 changed files with 11 additions and 13 deletions

View File

@@ -112,8 +112,8 @@ void MainWindow::init(const CRuntimeConfig &runtimeConfig)
this->connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedAtcStationsUpdateInterval, this->ui->comp_MainInfoArea->getAtcStationComponent(), &::CAtcStationComponent::setUpdateIntervalSeconds);
// log messages
this->connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, this, &MainWindow::ps_displayStatusMessageInGui);
this->connect(CLogHandler::instance(), &CLogHandler::remoteMessageLogged, this, &MainWindow::ps_displayStatusMessageInGui);
auto *logHandler = CLogHandler::instance()->handlerForPattern(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
this->connect(logHandler, &CLogPatternHandler::messageLogged, this, &MainWindow::ps_displayStatusMessageInGui);
Q_ASSERT(connect);
Q_UNUSED(connect); // suppress GCC warning in release build