Skip to content

Commit 3c220f4

Browse files
committed
MonInfoLogger -> MonLogger
1 parent 43c1bf6 commit 3c220f4

14 files changed

+49
-46
lines changed

src/Backends/ApMonBackend.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "ApMonBackend.h"
77
#include <iostream>
88
#include <sstream>
9-
#include "../MonInfoLogger.h"
9+
#include "../MonLogger.h"
1010
#include "../Exceptions/MonitoringException.h"
1111

1212
namespace AliceO2
@@ -24,7 +24,7 @@ ApMonBackend::ApMonBackend(const std::string& configurationFile)
2424
{
2525
try {
2626
mApMon = std::make_unique<ApMon>(const_cast<char*>(configurationFile.c_str()));
27-
MonInfoLogger::Get() << "ApMon backend initialized" << MonInfoLogger::End();
27+
MonLogger::Get() << "ApMon backend initialized" << MonLogger::End();
2828
}
2929
catch (std::runtime_error &e) {
3030
throw MonitoringException("ApMonBackend initialization", std::string(e.what()) + " (" + configurationFile + ")");

src/Backends/Flume.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ using AliceO2::InfoLogger::InfoLogger;
2222
Flume::Flume(const std::string &hostname, int port)
2323
{
2424
mTransport = std::make_unique<Transports::UDP>(hostname, port);
25-
MonInfoLogger::Get() << "Flume/UDP backend initialized"
26-
<< " ("<< hostname << ":" << port << ")" << MonInfoLogger::End();
25+
MonLogger::Get() << "Flume/UDP backend initialized"
26+
<< " ("<< hostname << ":" << port << ")" << MonLogger::End();
2727
}
2828

2929
std::string Flume::metricToJson(const Metric& metric)

src/Backends/Flume.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "Monitoring/Backend.h"
1010
#include "../Transports/TransportInterface.h"
11-
#include "../MonInfoLogger.h"
11+
#include "../MonLogger.h"
1212
#include <boost/property_tree/ptree.hpp>
1313
#include <chrono>
1414
#include <string>

src/Backends/InfluxDB.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ using AliceO2::InfoLogger::InfoLogger;
2323
InfluxDB::InfluxDB(const std::string &hostname, int port)
2424
{
2525
transport = std::make_unique<Transports::UDP>(hostname, port);
26-
MonInfoLogger::Get() << "InfluxDB/UDP backend initialized"
27-
<< " ("<< hostname << ":" << port << ")" << MonInfoLogger::End();
26+
MonLogger::Get() << "InfluxDB/UDP backend initialized"
27+
<< " ("<< hostname << ":" << port << ")" << MonLogger::End();
2828
}
2929

3030
InfluxDB::InfluxDB(const std::string &hostname, int port, const std::string& database)
3131
{
3232
transport = std::make_unique<Transports::HTTP>(
3333
"http://" + hostname + ":" + std::to_string(port) + "/write?db=" + database
3434
);
35-
MonInfoLogger::Get() << "InfluxDB/HTTP backend initialized" << " ("<< hostname
36-
<< ":" << port << "/write?db=" << database << ")" << MonInfoLogger::End();
35+
MonLogger::Get() << "InfluxDB/HTTP backend initialized" << " ("<< hostname
36+
<< ":" << port << "/write?db=" << database << ")" << MonLogger::End();
3737
}
3838

3939
inline unsigned long InfluxDB::convertTimestamp(const std::chrono::time_point<std::chrono::system_clock>& timestamp)

src/Backends/InfluxDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "Monitoring/Backend.h"
1010
#include "../Transports/TransportInterface.h"
11-
#include "../MonInfoLogger.h"
11+
#include "../MonLogger.h"
1212
#include <chrono>
1313
#include <string>
1414

src/Backends/InfoLoggerBackend.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "InfoLoggerBackend.h"
77

88
#include <iostream>
9-
#include "../MonInfoLogger.h"
9+
#include "../MonLogger.h"
1010

1111
namespace AliceO2
1212
{
@@ -28,7 +28,7 @@ inline unsigned long InfoLoggerBackend::convertTimestamp(const std::chrono::time
2828

2929
InfoLoggerBackend::InfoLoggerBackend()
3030
{
31-
MonInfoLogger::Get() << "InfoLogger backend initialized" << InfoLogger::endm;
31+
MonLogger::Get() << "InfoLogger backend initialized" << InfoLogger::endm;
3232
}
3333

3434
void InfoLoggerBackend::addGlobalTag(std::string name, std::string value)
@@ -48,10 +48,10 @@ void InfoLoggerBackend::send(const Metric& metric)
4848
}
4949
metricTags += tag.name + "=" + tag.value;
5050
}
51-
MonInfoLogger::Get() << InfoLogger::Severity::Debug << "InfoLoggerMonitoring : " << metric.getName() << ", "
52-
<< metric.getValue() << " Type: " << metric.getType() << ", "
53-
<< convertTimestamp(metric.getTimestamp()) << ", " << tagString << " " << metricTags
54-
<< InfoLogger::endm;
51+
mInfoLogger << InfoLogger::Severity::Debug << "InfoLoggerMonitoring : " << metric.getName() << ", "
52+
<< metric.getValue() << " Type: " << metric.getType() << ", "
53+
<< convertTimestamp(metric.getTimestamp()) << ", " << tagString << " " << metricTags
54+
<< InfoLogger::endm;
5555
}
5656

5757
} // namespace Backends

src/Backends/InfoLoggerBackend.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define ALICEO2_MONITORING_CORE_INFOLOGGER_BACKEND_H
88

99
#include "Monitoring/Backend.h"
10+
#include <InfoLogger/InfoLogger.hxx>
1011
#include <string>
1112

1213
namespace AliceO2
@@ -46,6 +47,8 @@ class InfoLoggerBackend final : public Backend
4647
unsigned long convertTimestamp(const std::chrono::time_point<std::chrono::system_clock>& timestamp);
4748

4849
std::string tagString; ///< Global tagset (common for each metric)
50+
51+
AliceO2::InfoLogger::InfoLogger mInfoLogger;
4952
};
5053

5154
} // namespace Backends

src/Collector.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <vector>
1414
#include <Configuration/ConfigurationFactory.h>
1515

16-
#include "MonInfoLogger.h"
16+
#include "MonLogger.h"
1717
#include "ProcessDetails.h"
1818
#include "Exceptions/MonitoringInternalException.h"
1919
#include "Backends/InfoLoggerBackend.h"
@@ -35,17 +35,17 @@ namespace Monitoring
3535

3636
Collector::Collector(const std::string& configPath)
3737
{
38-
MonInfoLogger::Get() << AliceO2::InfoLogger::InfoLogger::Severity::Debug
38+
MonLogger::Get() << AliceO2::InfoLogger::InfoLogger::Severity::Debug
3939
<< "Creating Monitoring instance from configuration: "
40-
<< configPath << MonInfoLogger::End();
40+
<< configPath << MonLogger::End();
4141

4242
std::unique_ptr<Configuration::ConfigurationInterface> configFile =
4343
Configuration::ConfigurationFactory::getConfiguration(configPath);
4444
if (configFile->get<int>("InfoLoggerBackend/enable").value_or(0) == 1) {
4545
mBackends.emplace_back(std::make_unique<Backends::InfoLoggerBackend>());
4646
}
4747
else {
48-
MonInfoLogger::Get() << "InfoLogger backend disabled" << MonInfoLogger::End();
48+
MonLogger::Get() << "InfoLogger backend disabled" << MonLogger::End();
4949
}
5050
#ifdef _WITH_APPMON
5151
if (configFile->get<int>("ApMon/enable").value_or(0) == 1) {
@@ -54,7 +54,7 @@ Collector::Collector(const std::string& configPath)
5454
));
5555
}
5656
else {
57-
MonInfoLogger::Get() << "ApMon backend disabled" << MonInfoLogger::End();
57+
MonLogger::Get() << "ApMon backend disabled" << MonLogger::End();
5858
}
5959
#endif
6060

@@ -66,7 +66,7 @@ Collector::Collector(const std::string& configPath)
6666
));
6767
}
6868
else {
69-
MonInfoLogger::Get() << "InfluxDB/UDP backend disabled" << MonInfoLogger::End();
69+
MonLogger::Get() << "InfluxDB/UDP backend disabled" << MonLogger::End();
7070
}
7171
if (configFile->get<int>("InfluxDB/enableHTTP").value_or(0) == 1) {
7272
mBackends.emplace_back(std::make_unique<Backends::InfluxDB>(
@@ -76,7 +76,7 @@ Collector::Collector(const std::string& configPath)
7676
));
7777
}
7878
else {
79-
MonInfoLogger::Get() << "InfluxDB/HTTP backend disabled" << MonInfoLogger::End();
79+
MonLogger::Get() << "InfluxDB/HTTP backend disabled" << MonLogger::End();
8080
}
8181
#endif
8282

@@ -87,7 +87,7 @@ Collector::Collector(const std::string& configPath)
8787
));
8888
}
8989
else {
90-
MonInfoLogger::Get() << "Flume backend disabled" << MonInfoLogger::End();
90+
MonLogger::Get() << "Flume backend disabled" << MonLogger::End();
9191
}
9292

9393
#ifdef _OS_LINUX
@@ -96,7 +96,7 @@ Collector::Collector(const std::string& configPath)
9696
int interval = configFile->get<int>("ProcessMonitor/interval").value();
9797
mMonitorRunning = true;
9898
mMonitorThread = std::thread(&Collector::processMonitorLoop, this, interval);
99-
MonInfoLogger::Get() << "Process Monitor : Automatic updates enabled" << MonInfoLogger::End();
99+
MonLogger::Get() << "Process Monitor : Automatic updates enabled" << MonLogger::End();
100100
}
101101
#endif
102102

src/DerivedMetrics.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <memory>
1313
#include <string>
1414
#include <vector>
15-
#include "MonInfoLogger.h"
15+
#include "MonLogger.h"
1616

1717
namespace AliceO2
1818
{
@@ -27,8 +27,8 @@ DerivedMetrics::DerivedMetrics(const unsigned int cacheSize) : mMaxVectorSize(ca
2727
void DerivedMetrics::registerMetric(std::string name, DerivedMetricMode mode)
2828
{
2929
mRegistered.emplace(std::pair<std::string, DerivedMetricMode>(name, mode));
30-
MonInfoLogger::Get() << "Monitoring : Metric " << name << " added to derived metrics"
31-
<< MonInfoLogger::End();
30+
MonLogger::Get() << "Monitoring : Metric " << name << " added to derived metrics"
31+
<< MonLogger::End();
3232
}
3333

3434
bool DerivedMetrics::isRegistered(std::string name)

src/Exceptions/MonitoringException.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
///
55

66
#include "MonitoringException.h"
7-
#include "../MonInfoLogger.h"
7+
#include "../MonLogger.h"
88

99
namespace AliceO2
1010
{
@@ -20,7 +20,7 @@ MonitoringException::MonitoringException(int code, const std::string& source, co
2020
std::stringstream ss;
2121
ss << "MonitoringException[" << source << "] (" << code << "): " << message;
2222
this->message = ss.str();
23-
MonInfoLogger::Get() << AliceO2::InfoLogger::InfoLogger::Severity::Error << message << MonInfoLogger::End();
23+
MonLogger::Get() << AliceO2::InfoLogger::InfoLogger::Severity::Error << message << MonLogger::End();
2424
}
2525

2626
const char* MonitoringException::what() const throw()

0 commit comments

Comments
 (0)