ProtoProxy: Logs are saved to a Logs subfolder.
This commit is contained in:
parent
273a53a758
commit
36a6df8a34
1
Tools/ProtoProxy/.gitignore
vendored
1
Tools/ProtoProxy/.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
Debug
|
Debug
|
||||||
Release
|
Release
|
||||||
|
Logs/
|
||||||
*.log
|
*.log
|
||||||
*.nbt
|
*.nbt
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
#include "Server.h"
|
#include "Server.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <direct.h> // For _mkdir()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -261,7 +264,14 @@ cConnection::cConnection(SOCKET a_ClientSocket, cServer & a_Server) :
|
|||||||
m_ServerBuffer(1024 KiB),
|
m_ServerBuffer(1024 KiB),
|
||||||
m_HasClientPinged(false)
|
m_HasClientPinged(false)
|
||||||
{
|
{
|
||||||
Printf(m_LogNameBase, "Log_%d", (int)time(NULL));
|
// Create the Logs subfolder, if not already created:
|
||||||
|
#if defined(_WIN32)
|
||||||
|
_mkdir("Logs");
|
||||||
|
#else
|
||||||
|
mkdir("Logs", 0777);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Printf(m_LogNameBase, "Logs/Log_%d", (int)time(NULL));
|
||||||
AString fnam(m_LogNameBase);
|
AString fnam(m_LogNameBase);
|
||||||
fnam.append(".log");
|
fnam.append(".log");
|
||||||
m_LogFile = fopen(fnam.c_str(), "w");
|
m_LogFile = fopen(fnam.c_str(), "w");
|
||||||
|
Loading…
Reference in New Issue
Block a user