removed logging from SAPFOR and SERVER, updated NPB and fdvm

This commit is contained in:
ALEXks
2025-01-28 10:09:10 +03:00
committed by Dudarenko
parent 44600a50c1
commit b76753c285
17 changed files with 51 additions and 40 deletions

View File

@@ -84,6 +84,10 @@ void Sleep(int millisec) { usleep(millisec * 2000); }
#endif
#define __print(prefix, format, ...) do { } while (0)
#define __print_log(file, format, ...) do { } while (0)
/*
#define __print(prefix, format, ...) do {\
printf((string("%s: ") + format + string("\n")).c_str(), prefix, ##__VA_ARGS__); \
fflush(NULL); \
@@ -98,10 +102,10 @@ void Sleep(int millisec) { usleep(millisec * 2000); }
fflush(file); \
} \
} while (0)
*/
#define SERV "[SERVER]"
static const char* VERSION = "9";
static const char* VERSION = "10";
static FILE* logFile = NULL;
extern void __bst_create(const char* name);
@@ -865,7 +869,7 @@ int main(int argc, char** argv)
}
__print(SERV, "Invalid SAPFOR socket, try to restart");
__print_log(logFile, "invalid SAPFOR socket, try to restart");
Sleep(500);
Sleep(100);
}
__bst_unlock();

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2382"
#define VERSION_SPF "2383"

View File

@@ -54,7 +54,10 @@ static FILE* logFile = NULL;
#define FILE_LOG "Components/Sapfor_log.txt"
#endif
#define __print(prefix, format, ...) do {\
#define __print(prefix, format, ...) do { } while (0)
#define __print_log(file, format, ...) do { } while (0)
/*#define __print(prefix, format, ...) do {\
printf((string("%s: ") + format + string("\n")).c_str(), prefix, ##__VA_ARGS__); \
fflush(NULL); \
} while (0)
@@ -68,7 +71,7 @@ static FILE* logFile = NULL;
fflush(file); \
} \
} while (0)
*/
#define CLIENT "[SAPFOR]"
static int doRecv(SOCKET& soc, string& command)
@@ -302,7 +305,7 @@ static int send(SOCKET& client, const wstring& messageIn)
char buf;
recv(client, &buf, 1, 0);
printf("%s: send start\n", CLIENT);
__print(CLIENT, "send start\n", CLIENT);
auto timeForPass = high_resolution_clock::now();
#ifdef _WIN32
err = send(client, result.c_str(), result.size(), 0);
@@ -311,9 +314,7 @@ static int send(SOCKET& client, const wstring& messageIn)
#endif
const float elapsed = duration_cast<milliseconds>(high_resolution_clock::now() - timeForPass).count() / 1000.;
printf("%s: send end with time %f sec\n", CLIENT, elapsed);
fflush(NULL);
__print(CLIENT, "send end with time %f sec\n", elapsed);
__print(CLIENT, "Send message with size %d", (int)result.size());
if (err != result.size())