MCPcopy Create free account
hub / github.com/Icinga/icinga2 / UpdateMinLogSeverity

Method UpdateMinLogSeverity

lib/base/logger.cpp:222–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222void Logger::UpdateMinLogSeverity()
223{
224 std::unique_lock<std::mutex> lock (m_UpdateMinLogSeverityMutex);
225 auto result (LogNothing);
226
227 for (auto& logger : Logger::GetLoggers()) {
228 ObjectLock llock (logger);
229
230 if (logger->IsActive()) {
231 result = std::min(result, logger->GetMinSeverity());
232 }
233 }
234
235 if (Logger::IsConsoleLogEnabled()) {
236 result = std::min(result, Logger::GetConsoleLogSeverity());
237 }
238
239#ifdef _WIN32
240 if (Logger::IsEarlyLoggingEnabled()) {
241 result = std::min(result, LogCritical);
242 }
243#endif /* _WIN32 */
244
245 m_MinLogSeverity.store(result);
246}
247
248Log::Log(LogSeverity severity, String facility, const String& message)
249 : Log(severity, std::move(facility))

Callers

nothing calls this directly

Calls 3

IsActiveMethod · 0.80
GetMinSeverityMethod · 0.80
storeMethod · 0.80

Tested by

no test coverage detected