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

Method GetCurrentLogLevel

Source/cmMakefile.cxx:226–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226Message::LogLevel cmMakefile::GetCurrentLogLevel() const
227{
228 cmake const* cmakeInstance = this->GetCMakeInstance();
229
230 Message::LogLevel const logLevelCliOrDefault = cmakeInstance->GetLogLevel();
231 assert("Expected a valid log level here" &&
232 logLevelCliOrDefault != Message::LogLevel::LOG_UNDEFINED);
233
234 Message::LogLevel result = logLevelCliOrDefault;
235
236 // If the log-level was set via the command line option, it takes precedence
237 // over the CMAKE_MESSAGE_LOG_LEVEL variable.
238 if (!cmakeInstance->WasLogLevelSetViaCLI()) {
239 Message::LogLevel const logLevelFromVar = cmake::StringToLogLevel(
240 this->GetSafeDefinition("CMAKE_MESSAGE_LOG_LEVEL"));
241 if (logLevelFromVar != Message::LogLevel::LOG_UNDEFINED) {
242 result = logLevelFromVar;
243 }
244 }
245
246 return result;
247}
248
249void cmMakefile::IssueInvalidTargetNameError(
250 std::string const& targetName) const

Callers 2

cmMessageCommandFunction · 0.80

Calls 3

GetCMakeInstanceMethod · 0.95
GetLogLevelMethod · 0.80
WasLogLevelSetViaCLIMethod · 0.80

Tested by

no test coverage detected