Logs functions fixes

This commit is contained in:
pokamest 2022-01-30 17:35:57 +03:00
parent 95fe09489c
commit d24f6ae064
15 changed files with 240 additions and 39 deletions

View file

@ -5,6 +5,8 @@
#include <QLocalSocket>
#include "router.h"
#include "log.h"
#ifdef Q_OS_WIN
#include "tapcontroller_win.h"
#endif
@ -33,7 +35,7 @@ int IpcServer::createPrivilegedProcess()
// Make sure any connections are handed to QtRO
QObject::connect(pd.localServer.data(), &QLocalServer::newConnection, this, [pd]() {
qDebug() << "LocalServer new connection";
qDebug() << "IpcServer new connection";
if (pd.serverNode) {
pd.serverNode->addHostSideConnection(pd.localServer->nextPendingConnection());
pd.serverNode->enableRemoting(pd.ipcProcess.data());
@ -105,3 +107,20 @@ QStringList IpcServer::getTapList()
return QStringList();
#endif
}
void IpcServer::cleanUp()
{
qDebug() << "IpcServer::cleanUp";
Log::deinit();
Log::cleanUp();
}
void IpcServer::setLogsEnabled(bool enabled)
{
if (enabled) {
Log::init();
}
else {
Log::deinit();
}
}