aboutsummaryrefslogtreecommitdiff
path: root/src/common/Metric/Metric.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-01-08 21:16:53 +0100
committerShauren <shauren.trinity@gmail.com>2023-01-08 21:16:53 +0100
commitd791afae1dfcfaf592326f787755ca32d629e4d3 (patch)
tree54dc9916ede5800e110a2f0edff91530811fbdb8 /src/common/Metric/Metric.cpp
parentb6820a706f46f18b9652fcd9806e4bec8805d29d (diff)
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
Diffstat (limited to 'src/common/Metric/Metric.cpp')
-rw-r--r--src/common/Metric/Metric.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp
index c924c233e02..7cd4f56fba5 100644
--- a/src/common/Metric/Metric.cpp
+++ b/src/common/Metric/Metric.cpp
@@ -41,8 +41,8 @@ bool Metric::Connect()
auto error = stream.error();
if (error)
{
- TC_LOG_ERROR("metric", "Error connecting to '%s:%s', disabling Metric. Error message : %s",
- _hostname.c_str(), _port.c_str(), error.message().c_str());
+ TC_LOG_ERROR("metric", "Error connecting to '{}:{}', disabling Metric. Error message : {}",
+ _hostname, _port, error.message());
_enabled = false;
return false;
}
@@ -57,14 +57,14 @@ void Metric::LoadFromConfigs()
_updateInterval = sConfigMgr->GetIntDefault("Metric.Interval", 1);
if (_updateInterval < 1)
{
- TC_LOG_ERROR("metric", "'Metric.Interval' config set to %d, overriding to 1.", _updateInterval);
+ TC_LOG_ERROR("metric", "'Metric.Interval' config set to {}, overriding to 1.", _updateInterval);
_updateInterval = 1;
}
_overallStatusTimerInterval = sConfigMgr->GetIntDefault("Metric.OverallStatusInterval", 1);
if (_overallStatusTimerInterval < 1)
{
- TC_LOG_ERROR("metric", "'Metric.OverallStatusInterval' config set to %d, overriding to 1.", _overallStatusTimerInterval);
+ TC_LOG_ERROR("metric", "'Metric.OverallStatusInterval' config set to {}, overriding to 1.", _overallStatusTimerInterval);
_overallStatusTimerInterval = 1;
}
@@ -206,7 +206,7 @@ void Metric::SendBatch()
GetDataStream() >> status_code;
if (status_code != 204)
{
- TC_LOG_ERROR("metric", "Error sending data, returned HTTP code: %u", status_code);
+ TC_LOG_ERROR("metric", "Error sending data, returned HTTP code: {}", status_code);
}
// Read and ignore the status description