mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
Logs functions fixes
This commit is contained in:
@@ -15,5 +15,8 @@ class IpcInterface
|
||||
|
||||
SLOT( bool checkAndInstallDriver() );
|
||||
SLOT( QStringList getTapList() );
|
||||
|
||||
SLOT( void cleanUp() );
|
||||
SLOT( void setLogsEnabled(bool enabled) );
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ public:
|
||||
virtual void resetIpStack() override;
|
||||
virtual bool checkAndInstallDriver() override;
|
||||
virtual QStringList getTapList() override;
|
||||
virtual void cleanUp() override;
|
||||
virtual void setLogsEnabled(bool enabled) override;
|
||||
|
||||
private:
|
||||
int m_localpid = 0;
|
||||
|
||||
Reference in New Issue
Block a user