diff --git a/assignment-client/src/AssignmentClientApp.cpp b/assignment-client/src/AssignmentClientApp.cpp index 2fa052e244..162f18f712 100644 --- a/assignment-client/src/AssignmentClientApp.cpp +++ b/assignment-client/src/AssignmentClientApp.cpp @@ -240,6 +240,9 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : QThread::currentThread()->setObjectName("main thread"); + LogHandler::getInstance().setParent(this); + LogHandler::getInstance().setupRepeatedMessageFlusher(); + DependencyManager::registerInheritance(); DependencyManager::set(); diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 307a43ee88..bad553c65e 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -174,6 +174,9 @@ DomainServer::DomainServer(int argc, char* argv[]) : LogUtils::init(); + LogHandler::getInstance().setParent(this); + LogHandler::getInstance().setupRepeatedMessageFlusher(); + qDebug() << "Setting up domain-server"; qDebug() << "[VERSION] Build sequence:" << qPrintable(applicationVersion()); qDebug() << "[VERSION] MODIFIED_ORGANIZATION:" << BuildInfo::MODIFIED_ORGANIZATION; @@ -320,7 +323,7 @@ DomainServer::DomainServer(int argc, char* argv[]) : connect(_contentManager.get(), &DomainContentBackupManager::recoveryCompleted, this, &DomainServer::restart); -static const int NODE_PING_MONITOR_INTERVAL_MSECS = 1 * MSECS_PER_SECOND; + static const int NODE_PING_MONITOR_INTERVAL_MSECS = 1 * MSECS_PER_SECOND; _nodePingMonitorTimer = new QTimer{ this }; connect(_nodePingMonitorTimer, &QTimer::timeout, this, &DomainServer::nodePingMonitor); _nodePingMonitorTimer->start(NODE_PING_MONITOR_INTERVAL_MSECS); diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 388775cba5..acac514a18 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1060,6 +1060,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); setProperty(hifi::properties::CRASHED, _previousSessionCrashed); + LogHandler::getInstance().setParent(this); + LogHandler::getInstance().setupRepeatedMessageFlusher(); + { const QStringList args = arguments(); diff --git a/libraries/shared/src/LogHandler.cpp b/libraries/shared/src/LogHandler.cpp index c51d9bf611..aff4de6e3a 100644 --- a/libraries/shared/src/LogHandler.cpp +++ b/libraries/shared/src/LogHandler.cpp @@ -32,14 +32,6 @@ LogHandler& LogHandler::getInstance() { return staticInstance; } -LogHandler::LogHandler() { - // make sure we setup the repeated message flusher, but do it on the LogHandler thread - QMetaObject::invokeMethod(this, "setupRepeatedMessageFlusher"); -} - -LogHandler::~LogHandler() { -} - const char* stringForLogType(LogMsgType msgType) { switch (msgType) { case LogInfo: diff --git a/libraries/shared/src/LogHandler.h b/libraries/shared/src/LogHandler.h index 56450768ff..8f84899b78 100644 --- a/libraries/shared/src/LogHandler.h +++ b/libraries/shared/src/LogHandler.h @@ -54,12 +54,11 @@ public: int newRepeatedMessageID(); void printRepeatedMessage(int messageID, LogMsgType type, const QMessageLogContext& context, const QString &message); -private slots: void setupRepeatedMessageFlusher(); private: - LogHandler(); - ~LogHandler(); + LogHandler() = default; + ~LogHandler() = default; void flushRepeatedMessages();