MCPcopy Create free account
hub / github.com/ddnet/ddnet / Con_DbgLognetwork

Method Con_DbgLognetwork

src/engine/shared/engine.cpp:29–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 CJobPool m_JobPool;
28
29 static void Con_DbgLognetwork(IConsole::IResult *pResult, void *pUserData)
30 {
31 CEngine *pEngine = static_cast<CEngine *>(pUserData);
32
33 if(pEngine->m_Logging)
34 {
35 CNetBase::CloseLog();
36 pEngine->m_Logging = false;
37 }
38 else
39 {
40 char aBuf[32];
41 str_timestamp(aBuf, sizeof(aBuf));
42 char aFilenameSent[IO_MAX_PATH_LENGTH], aFilenameRecv[IO_MAX_PATH_LENGTH];
43 str_format(aFilenameSent, sizeof(aFilenameSent), "dumps/network_sent_%s.txt", aBuf);
44 str_format(aFilenameRecv, sizeof(aFilenameRecv), "dumps/network_recv_%s.txt", aBuf);
45 CNetBase::OpenLog(pEngine->m_pStorage->OpenFile(aFilenameSent, IOFLAG_WRITE, IStorage::TYPE_SAVE),
46 pEngine->m_pStorage->OpenFile(aFilenameRecv, IOFLAG_WRITE, IStorage::TYPE_SAVE));
47 pEngine->m_Logging = true;
48 }
49 }
50
51public:
52 CEngine(bool Test, const char *pAppname, std::shared_ptr<CFutureLogger> pFutureLogger) :

Callers

nothing calls this directly

Calls 3

str_timestampFunction · 0.85
str_formatFunction · 0.85
OpenFileMethod · 0.45

Tested by

no test coverage detected