Skip to content

Commit 84f7c63

Browse files
authored
[OMON-599] Use InfoLogger devel level (#305)
1 parent 9f4b289 commit 84f7c63

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ endif()
3131

3232
# Define project
3333
project(Monitoring
34-
VERSION 3.13.2
34+
VERSION 3.14.0
3535
DESCRIPTION "O2 Monitoring library"
3636
LANGUAGES CXX
3737
)

src/DerivedMetrics.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ bool DerivedMetrics::process(Metric& metric, DerivedMetricMode mode)
8080
int timestampCount = timestampDifference.count();
8181
// disallow dividing by 0
8282
if (timestampCount == 0) {
83-
throw MonitoringException("DerivedMetrics", "Division by 0");
83+
throw MonitoringException("DerivedMetrics", "Division by 0 when calculating rate for: " + metric.getFirstValue().first);
8484
}
8585

8686
auto current = metric.getFirstValue().second;

src/MonLogger.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ class MonLogger
9898
context.setField(InfoLoggerContext::FieldName::System, "Monitoring");
9999
context.setField(InfoLoggerContext::FieldName::Facility, "Library");
100100
mStream.setContext(context);
101-
static InfoLogger::AutoMuteToken wToken({InfoLogger::Severity::Warning, InfoLogger::Level::Support, -1, nullptr, -1}, 2, 60);
101+
static InfoLogger::AutoMuteToken wToken({InfoLogger::Severity::Warning, InfoLogger::Level::Devel, -1, nullptr, -1}, 2, 60);
102102

103103
mMute = (static_cast<int>(severity) >= static_cast<int>(mLoggerSeverity) || severity == Severity::Error) ? false : true;
104-
switch(severity) {
105-
case Severity::Warn: mStream << &wToken; break;
106-
default: mStream << static_cast<InfoLogger::Severity>(severity); break;
104+
if (severity == Severity::Warn) {
105+
mStream << &wToken;
106+
} else {
107+
mStream << InfoLogger::InfoLoggerMessageOption { static_cast<InfoLogger::Severity>(severity), InfoLogger::Level::Devel, -1, __FILE__, __LINE__ };
107108
}
108109
}
109110
#else

test/testDerived.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ bool exceptionCheck(const MonitoringException& e)
166166
{
167167
if (e.what() == std::string("Not enough values"))
168168
return true;
169-
if (e.what() == std::string("Division by 0"))
169+
if (std::string(e.what()).find("Division by 0") != std::string::npos)
170170
return true;
171171
return false;
172172
}

0 commit comments

Comments
 (0)