MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / InternalLogMessage

Method InternalLogMessage

src/Platform/Logger.cpp:151–176  ·  view source on GitHub ↗

Version of LogMessage for when we already know we want to proceed and we have already set inLogger

Source from the content-addressed store, hash-verified

149
150// Version of LogMessage for when we already know we want to proceed and we have already set inLogger
151void Logger::InternalLogMessage(time_t currentTime, const char *_ecv_array message, const MessageLogLevel messageLogLevel) noexcept
152{
153 bool ok = WriteDateTimeAndLogLevelPrefix(currentTime, messageLogLevel);
154 if (ok)
155 {
156 const size_t len = strlen(message);
157 if (len != 0)
158 {
159 ok = logFile.Write(message, len);
160 }
161 if (ok && (len == 0 || message[len - 1] != '\n'))
162 {
163 ok = logFile.Write('\n');
164 }
165 }
166
167 if (ok)
168 {
169 dirty = true;
170 }
171 else
172 {
173 logFile.Close();
174 reprap.StateUpdated();
175 }
176}
177
178// This is called regularly by Platform to give the logger an opportunity to flush the file buffer
179void Logger::Flush(bool forced) noexcept

Callers

nothing calls this directly

Calls 3

StateUpdatedMethod · 0.80
WriteMethod · 0.60
CloseMethod · 0.45

Tested by

no test coverage detected