Merge branch 'dev' of github.com:amnezia-vpn/desktop-client into feature/qt6-libssh-support
This commit is contained in:
commit
74fbce8b96
279 changed files with 3217 additions and 14329 deletions
|
@ -15,7 +15,7 @@ set(HEADERS
|
|||
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserver.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserverprocess.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/localserver.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/log.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/logger.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/router.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/systemservice.h
|
||||
)
|
||||
|
@ -25,7 +25,7 @@ set(SOURCES
|
|||
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserver.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipcserverprocess.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/localserver.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/log.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/logger.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/main.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/router.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/systemservice.cpp
|
||||
|
@ -82,9 +82,9 @@ endif()
|
|||
include(${CMAKE_CURRENT_LIST_DIR}/../src/qtservice.cmake)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../client
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../ipc
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
@ -104,7 +104,7 @@ if(WIN32)
|
|||
set(DEPLOY_ARTIFACT_PATH "windows/x32")
|
||||
endif()
|
||||
elseif(LINUX)
|
||||
set(DEPLOY_ARTIFACT_PATH "linux/serivce")
|
||||
set(DEPLOY_ARTIFACT_PATH "linux/service")
|
||||
elseif(APPLE AND NOT IOS)
|
||||
set(DEPLOY_ARTIFACT_PATH "macos")
|
||||
endif()
|
||||
|
@ -117,4 +117,4 @@ if(NOT IOS AND NOT ANDROID)
|
|||
$<TARGET_FILE_DIR:${PROJECT}>
|
||||
COMMAND_EXPAND_LISTS
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#include "logger.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "log.h"
|
||||
#include "defines.h"
|
||||
#include "utilities.h"
|
||||
|
||||
QFile Log::m_file;
|
||||
QTextStream Log::m_textStream;
|
||||
QString Log::m_logFileName = QString("%1.log").arg(SERVICE_NAME);
|
||||
QFile Logger::m_file;
|
||||
QTextStream Logger::m_textStream;
|
||||
QString Logger::m_logFileName = QString("%1.log").arg(SERVICE_NAME);
|
||||
|
||||
void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
|
||||
{
|
||||
|
@ -17,12 +18,12 @@ void debugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons
|
|||
return;
|
||||
}
|
||||
|
||||
Log::m_textStream << qFormatLogMessage(type, context, msg) << Qt::endl << Qt::flush;
|
||||
Logger::m_textStream << qFormatLogMessage(type, context, msg) << Qt::endl << Qt::flush;
|
||||
|
||||
std::cout << qFormatLogMessage(type, context, msg).toStdString() << std::endl << std::flush;
|
||||
}
|
||||
|
||||
bool Log::init()
|
||||
bool Logger::init()
|
||||
{
|
||||
if (m_file.isOpen()) return true;
|
||||
|
||||
|
@ -46,19 +47,19 @@ bool Log::init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void Log::deinit()
|
||||
void Logger::deinit()
|
||||
{
|
||||
m_file.close();
|
||||
m_textStream.setDevice(nullptr);
|
||||
qInstallMessageHandler(nullptr);
|
||||
}
|
||||
|
||||
QString Log::serviceLogFileNamePath()
|
||||
QString Logger::serviceLogFileNamePath()
|
||||
{
|
||||
return m_file.fileName();
|
||||
}
|
||||
|
||||
void Log::clearLogs()
|
||||
void Logger::clearLogs()
|
||||
{
|
||||
bool isLogActive = m_file.isOpen();
|
||||
m_file.close();
|
||||
|
@ -78,7 +79,7 @@ void Log::clearLogs()
|
|||
}
|
||||
}
|
||||
|
||||
void Log::cleanUp()
|
||||
void Logger::cleanUp()
|
||||
{
|
||||
clearLogs();
|
||||
deinit();
|
|
@ -1,12 +1,12 @@
|
|||
#ifndef LOG_H
|
||||
#define LOG_H
|
||||
#ifndef LOGGER_H
|
||||
#define LOGGER_H
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <QString>
|
||||
#include <QTextStream>
|
||||
|
||||
class Log
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
static bool init();
|
||||
|
@ -25,4 +25,4 @@ private:
|
|||
static QTextStream m_textStream;
|
||||
};
|
||||
|
||||
#endif // LOG_H
|
||||
#endif // LOGGER_H
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "defines.h"
|
||||
#include "localserver.h"
|
||||
#include "log.h"
|
||||
#include "logger.h"
|
||||
#include "systemservice.h"
|
||||
#include "utilities.h"
|
||||
|
||||
|
@ -20,7 +20,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
Utils::initializePath(Utils::systemLogPath());
|
||||
|
||||
Log::init();
|
||||
Logger::init();
|
||||
|
||||
if (argc == 2) {
|
||||
qInfo() << "Started as console application";
|
||||
|
|
|
@ -10,7 +10,7 @@ HEADERS = \
|
|||
../../ipc/ipcserver.h \
|
||||
../../ipc/ipcserverprocess.h \
|
||||
localserver.h \
|
||||
log.h \
|
||||
logger.h \
|
||||
router.h \
|
||||
systemservice.h
|
||||
|
||||
|
@ -19,7 +19,7 @@ SOURCES = \
|
|||
../../ipc/ipcserver.cpp \
|
||||
../../ipc/ipcserverprocess.cpp \
|
||||
localserver.cpp \
|
||||
log.cpp \
|
||||
logger.cpp \
|
||||
main.cpp \
|
||||
router.cpp \
|
||||
systemservice.cpp
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
# define QT_QTSERVICE_EXPORT
|
||||
#endif
|
||||
|
||||
//class QStringList;
|
||||
class QtServiceControllerPrivate;
|
||||
|
||||
class QT_QTSERVICE_EXPORT QtServiceController
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue