diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
commit | aaa6e73c8ca6d60e943cb964605536eb78219db2 (patch) | |
tree | f5a0187925e646ef071d647efa7a5dac20501813 /src/common/Metric/Metric.cpp | |
parent | 825c697a764017349ca94ecfca8f30a8365666c0 (diff) |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
(cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3)
Diffstat (limited to 'src/common/Metric/Metric.cpp')
-rw-r--r-- | src/common/Metric/Metric.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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 |