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

Method Dump

src/engine/shared/assertion_logger.cpp:50–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void CAssertionLogger::Dump()
51{
52 char aAssertLogFile[IO_MAX_PATH_LENGTH];
53 char aDate[64];
54 str_timestamp(aDate, sizeof(aDate));
55 str_format(aAssertLogFile, std::size(aAssertLogFile), "%s%s_assert_log_%s_%d.txt", m_aAssertLogPath, m_aGameName, aDate, process_id());
56 const CLockScope LockScope(m_DbgMessageMutex);
57 IOHANDLE FileHandle = io_open(aAssertLogFile, IOFLAG_WRITE);
58 if(FileHandle)
59 {
60 auto *pIt = m_DbgMessages.First();
61 while(pIt)
62 {
63 io_write(FileHandle, pIt->m_aMessage, str_length(pIt->m_aMessage));
64 io_write(FileHandle, "\n", 1);
65
66 pIt = m_DbgMessages.Next(pIt);
67 }
68
69 io_sync(FileHandle);
70 io_close(FileHandle);
71 }
72}
73
74CAssertionLogger::CAssertionLogger(const char *pAssertLogPath, const char *pGameName)
75{

Callers

nothing calls this directly

Calls 10

str_timestampFunction · 0.85
str_formatFunction · 0.85
process_idFunction · 0.85
io_openFunction · 0.85
io_writeFunction · 0.85
str_lengthFunction · 0.85
io_syncFunction · 0.85
io_closeFunction · 0.85
FirstMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected