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

Function LogFunc

lib/mdflib/mdflib_test/src/testmultipledgwrite.cpp:37–52  ·  view source on GitHub ↗

* Function that connect the MDF library to the UTIL library log functionality. * @param location Source file and line location * @param severity Severity code * @param text Log text */

Source from the content-addressed store, hash-verified

35 * @param text Log text
36 */
37void LogFunc(const MdfLocation& location, mdf::MdfLogSeverity severity,
38 const std::string& text) {
39 const auto &log_config = LogConfig::Instance();
40
41 // Copy MdfLocation to std::source_location is still a problem.
42 // Adding it to the text for the time being.
43 std::ostringstream temp;
44 temp << text << " [" << location.file
45 << "::" << location.function
46 << ":" << location.line << "]";
47 LogMessage message;
48 message.message = temp.str();
49 message.severity = static_cast<LogSeverity>(severity);
50
51 log_config.AddLogMessage(message);
52}
53/**
54 * Function that stops logging of MDF logs
55 */

Callers

nothing calls this directly

Calls 1

AddLogMessageMethod · 0.45

Tested by

no test coverage detected