MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / AddLogMessage

Method AddLogMessage

lib/mdflib/mdfviewer/src/util/logfile.cpp:195–208  ·  view source on GitHub ↗

* Adds a log message to the internal message queue. The queue is saved to a * file by a worker thread. * @param [in] message Message to handle. */

Source from the content-addressed store, hash-verified

193 * @param [in] message Message to handle.
194 */
195void LogFile::AddLogMessage(const LogMessage &message) {
196 if (stop_thread_ || !IsSeverityLevelEnabled(message.severity)) {
197 return;
198 }
199
200 {
201 std::lock_guard<std::mutex> lock(locker_);
202 if (stop_thread_) {
203 return;
204 }
205 message_list_.push(message);
206 }
207 condition_.notify_one();
208}
209
210/**
211 * Stops the working thread. This means that all messages in the queue is saved

Callers 12

LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
LogFuncFunction · 0.45
SendLogMessageFunction · 0.45

Calls 1

pushMethod · 0.80

Tested by 10

LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36
LogFuncFunction · 0.36