Skip to content

Commit

Permalink
[OMON-661] Move Monitoring logs to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
awegrzyn committed Apr 19, 2023
1 parent 9a24cf7 commit 8cb92a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/MonitoringException.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace monitoring
MonitoringException::MonitoringException(const std::string& source, const std::string& message)
: message(message)
{
MonLogger::Get(Severity::Error) << "MonitoringException["
MonLogger::Get(Severity::Warn) << "MonitoringException["
<< source << "] : " << message << MonLogger::End();
}

Expand Down
4 changes: 2 additions & 2 deletions src/MonLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ class MonLogger
context.setField(InfoLoggerContext::FieldName::System, "Monitoring");
context.setField(InfoLoggerContext::FieldName::Facility, "Library");
mStream.setContext(context);
static InfoLogger::AutoMuteToken wToken({InfoLogger::Severity::Warning, InfoLogger::Level::Devel, -1, nullptr, -1}, 2, 60);
static InfoLogger::AutoMuteToken wToken({InfoLogger::Severity::Warning, InfoLogger::Level::Trace, -1, nullptr, -1}, 2, 60);

mMute = (static_cast<int>(severity) >= static_cast<int>(mLoggerSeverity) || severity == Severity::Error) ? false : true;
if (severity == Severity::Warn) {
mStream << &wToken;
} else {
mStream << InfoLogger::InfoLoggerMessageOption { static_cast<InfoLogger::Severity>(severity), InfoLogger::Level::Devel, -1, __FILE__, __LINE__ };
mStream << InfoLogger::InfoLoggerMessageOption { static_cast<InfoLogger::Severity>(severity), InfoLogger::Level::Trace, -1, __FILE__, __LINE__ };
}
}
#else
Expand Down
4 changes: 1 addition & 3 deletions src/Monitoring.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ void Monitoring::send(Metric&& metric, DerivedMetricMode mode)
if (!mDerivedHandler->process(metric, mode)) {
return;
}
} catch (MonitoringException& e) {
MonLogger::Get() << e.what() << MonLogger::End();
}
} catch (MonitoringException& e) {}
}
transmit(std::move(metric));
}
Expand Down

0 comments on commit 8cb92a8

Please sign in to comment.