MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / getLastLogs

Function getLastLogs

lib/Logging/Logging.cpp:68–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::string getLastLogs() {
69 if (rtcLogMagic != LOG_RTC_MAGIC) {
70 return {};
71 }
72 std::string output;
73 for (size_t i = 0; i < MAX_LOG_LINES; i++) {
74 size_t idx = (logHead + i) % MAX_LOG_LINES;
75 if (logMessages[idx][0] != '\0') {
76 const size_t len = strnlen(logMessages[idx], MAX_ENTRY_LEN);
77 output.append(logMessages[idx], len);
78 }
79 }
80 return output;
81}
82
83// Checks whether the RTC log state is consistent: rtcLogMagic must equal
84// LOG_RTC_MAGIC and logHead must be in 0..MAX_LOG_LINES-1. Returns true if

Callers 1

getPanicInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected