This commit is contained in:
2025-06-16 08:52:40 +08:00
commit e53dc4a080
23 changed files with 1725 additions and 0 deletions

47
Test/LogTest.cpp Normal file
View File

@ -0,0 +1,47 @@
#include "Test.h"
#include "ConfigParser.h"
#include "LogL.h"
using namespace std;
void Log_Test() {
unordered_map<string, string> config;
configFromIni("ini\\config.ini", config);
//日志类型
LogType tmpLogType = LTStd;
auto tmp = config.find("logType");
if (tmp != config.end()) {
if (tmp->second == "udp") {
tmpLogType = LTUdp;
}
else if (tmp->second == "txt") {
tmpLogType = LTTxt;
}
else if (tmp->second == "std") {
tmpLogType = LTStd;
}
}
//日志地址
string tmpLogPath;
tmp = config.find("logPath");
if (tmp != config.end()) {
tmpLogPath = tmp->second;
}
//日志状态
bool tmpLogStatus = true;
tmp = config.find("logStatus");
if (tmp != config.end()) {
if (tmp->second == "sync") {
tmpLogStatus = true;
}
else {
tmpLogStatus = false;
}
}
LogL logL(tmpLogType, tmpLogStatus, tmpLogPath);
}