From aaa6e73c8ca6d60e943cb964605536eb78219db2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 15 Aug 2023 20:10:04 +0200 Subject: Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) (cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3) --- src/common/Metric/Metric.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/common/Metric/Metric.cpp') diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp index 843f4c16f56..06c084a3c2c 100644 --- a/src/common/Metric/Metric.cpp +++ b/src/common/Metric/Metric.cpp @@ -42,8 +42,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; } @@ -58,14 +58,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; } @@ -201,7 +201,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 -- cgit v1.2.3