Issue #15 Classes for sharing the history of log messages

This commit is contained in:
Mat Sutcliffe
2020-04-15 18:18:43 +01:00
parent 151810d6fc
commit 7382564633
7 changed files with 144 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
#include "blackcore/context/contextownaircraftimpl.h"
#include "blackcore/context/contextsimulator.h"
#include "blackmisc/sharedstate/datalinkdbus.h"
#include "blackmisc/loghistory.h"
#include "blackcore/context/contextsimulatorimpl.h"
#include "blackcore/data/launchersetup.h"
#include "blackcore/corefacadeconfig.h"
@@ -123,6 +124,15 @@ namespace BlackCore
qFatal("Invalid application context mode");
}
// shared log history
m_logHistorySource = new CLogHistorySource(this);
m_logHistorySource->initialize(m_dataLinkDBus);
if (m_config.hasLocalCore())
{
m_logHistory = new CLogHistory(this);
m_logHistory->initialize(m_dataLinkDBus);
}
// contexts
if (m_contextApplication) { m_contextApplication->deleteLater(); }
m_contextApplication = IContextApplication::create(this, m_config.getModeApplication(), m_dbusServer, m_dbusConnection);
@@ -331,6 +341,10 @@ namespace BlackCore
disconnect(this);
// tear down shared state infrastructure
delete m_logHistory;
m_logHistory = nullptr;
delete m_logHistorySource;
m_logHistorySource = nullptr;
delete m_dataLinkDBus;
m_dataLinkDBus = nullptr;