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

Method SeverityToString

lib/base/logger.cpp:111–127  ·  view source on GitHub ↗

* Converts a severity enum value to a string. * * @param severity The severity value. */

Source from the content-addressed store, hash-verified

109 * @param severity The severity value.
110 */
111String Logger::SeverityToString(LogSeverity severity)
112{
113 switch (severity) {
114 case LogDebug:
115 return "debug";
116 case LogNotice:
117 return "notice";
118 case LogInformation:
119 return "information";
120 case LogWarning:
121 return "warning";
122 case LogCritical:
123 return "critical";
124 default:
125 BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid severity."));
126 }
127}
128
129/**
130 * Converts a string to a severity enum value.

Callers 1

TestLoggerFixtureMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestLoggerFixtureMethod · 0.64