Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)

(cherry picked from commit d791afae1d)
This commit is contained in:
Shauren
2023-08-15 20:10:04 +02:00
parent 825c697a76
commit aaa6e73c8c
252 changed files with 4596 additions and 4653 deletions

View File

@@ -87,10 +87,10 @@ bool AuctionBotConfig::Initialize()
} while (result->NextRow());
}
TC_LOG_DEBUG("ahbot", "AuctionHouseBot found %u characters", count);
TC_LOG_DEBUG("ahbot", "AuctionHouseBot found {} characters", count);
}
else
TC_LOG_WARN("ahbot", "AuctionHouseBot Account ID %u has no associated characters.", ahBotAccId);
TC_LOG_WARN("ahbot", "AuctionHouseBot Account ID {} has no associated characters.", ahBotAccId);
}
return true;
@@ -102,7 +102,7 @@ void AuctionBotConfig::SetConfig(AuctionBotConfigUInt32Values index, char const*
if (int32(GetConfig(index)) < 0)
{
TC_LOG_ERROR("ahbot", "AHBot: %s (%i) can't be negative. Using %u instead.", fieldname, int32(GetConfig(index)), defvalue);
TC_LOG_ERROR("ahbot", "AHBot: {} ({}) can't be negative. Using {} instead.", fieldname, int32(GetConfig(index)), defvalue);
SetConfig(index, defvalue);
}
}
@@ -113,7 +113,7 @@ void AuctionBotConfig::SetConfigMax(AuctionBotConfigUInt32Values index, char con
if (GetConfig(index) > maxvalue)
{
TC_LOG_ERROR("ahbot", "AHBot: %s (%u) must be in range 0...%u. Using %u instead.", fieldname, GetConfig(index), maxvalue, maxvalue);
TC_LOG_ERROR("ahbot", "AHBot: {} ({}) must be in range 0...{}. Using {} instead.", fieldname, GetConfig(index), maxvalue, maxvalue);
SetConfig(index, maxvalue);
}
}
@@ -124,13 +124,13 @@ void AuctionBotConfig::SetConfigMinMax(AuctionBotConfigUInt32Values index, char
if (GetConfig(index) > maxvalue)
{
TC_LOG_ERROR("ahbot", "AHBot: %s (%u) must be in range %u...%u. Using %u instead.", fieldname, GetConfig(index), minvalue, maxvalue, maxvalue);
TC_LOG_ERROR("ahbot", "AHBot: {} ({}) must be in range {}...{}. Using {} instead.", fieldname, GetConfig(index), minvalue, maxvalue, maxvalue);
SetConfig(index, maxvalue);
}
if (GetConfig(index) < minvalue)
{
TC_LOG_ERROR("ahbot", "AHBot: %s (%u) must be in range %u...%u. Using %u instead.", fieldname, GetConfig(index), minvalue, maxvalue, minvalue);
TC_LOG_ERROR("ahbot", "AHBot: {} ({}) must be in range {}...{}. Using {} instead.", fieldname, GetConfig(index), minvalue, maxvalue, minvalue);
SetConfig(index, minvalue);
}
}