MCPcopy Create free account
hub / github.com/Kitware/CMake / LogMessage

Method LogMessage

Source/cmSarifLog.cxx:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void cmSarif::ResultsLog::LogMessage(
78 MessageType t, std::string const& text,
79 cmListFileBacktrace const& backtrace) const
80{
81 // Add metadata to the result object
82 // The CMake SARIF rules for messages all expect 1 string argument with the
83 // message text
84 Json::Value additionalProperties(Json::objectValue);
85 Json::Value args(Json::arrayValue);
86 args.append(text);
87 additionalProperties["message"]["id"] = "default";
88 additionalProperties["message"]["arguments"] = args;
89
90 // Create and log a result object
91 // Rule indices are assigned when writing the final JSON output. Right now,
92 // leave it as nullopt. The other optional fields are filled if available
93 this->Log(cmSarif::Result{
94 text, cmSarif::SourceFileLocation::FromBacktrace(backtrace),
95 cmSarif::MessageSeverityLevel(t), cmSarif::MessageRuleId(t), cm::nullopt,
96 additionalProperties });
97}
98
99std::size_t cmSarif::ResultsLog::UseRule(std::string const& id) const
100{

Callers 1

DisplayMessageMethod · 0.45

Calls 2

LogMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected