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

This commit is contained in:
Shauren
2023-01-08 21:16:53 +01:00
parent b6820a706f
commit d791afae1d
294 changed files with 4921 additions and 4944 deletions

View File

@@ -22,36 +22,36 @@
void ServiceBase::LogDisallowedMethod(uint32 methodId)
{
TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u",
GetCallerInfo().c_str(), methodId);
TC_LOG_ERROR("service.protobuf", "{} Server tried to call server method {}",
GetCallerInfo(), methodId);
}
void ServiceBase::LogCallClientMethod(char const* methodName, char const* inputTypeName, google::protobuf::Message const* request)
{
TC_LOG_DEBUG("service.protobuf", "%s Server called client method %s(%s{ %s })",
GetCallerInfo().c_str(), methodName, inputTypeName, request->ShortDebugString().c_str());
TC_LOG_DEBUG("service.protobuf", "{} Server called client method {}({}{{ {} }})",
GetCallerInfo(), methodName, inputTypeName, request->ShortDebugString());
}
void ServiceBase::LogCallServerMethod(char const* methodName, char const* inputTypeName, google::protobuf::Message const* request)
{
TC_LOG_DEBUG("service.protobuf", "%s Client called server method %s(%s{ %s }).",
GetCallerInfo().c_str(), methodName, inputTypeName, request->ShortDebugString().c_str());
TC_LOG_DEBUG("service.protobuf", "{} Client called server method {}({}{{ {} }}).",
GetCallerInfo(), methodName, inputTypeName, request->ShortDebugString());
}
void ServiceBase::LogUnimplementedServerMethod(char const* methodName, google::protobuf::Message const* request)
{
TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method %s({ %s })",
GetCallerInfo().c_str(), methodName, request->ShortDebugString().c_str());
TC_LOG_ERROR("service.protobuf", "{} Client tried to call not implemented method {}({{ {} }})",
GetCallerInfo(), methodName, request->ShortDebugString());
}
void ServiceBase::LogInvalidMethod(uint32 methodId)
{
TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId);
TC_LOG_ERROR("service.protobuf", "Bad method id {}.", methodId);
}
void ServiceBase::LogFailedParsingRequest(char const* methodName)
{
TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for %s server method call.", GetCallerInfo().c_str(), methodName);
TC_LOG_DEBUG("service.protobuf", "{} Failed to parse request for {} server method call.", GetCallerInfo(), methodName);
}
std::function<void(ServiceBase*, uint32, google::protobuf::Message const*)> ServiceBase::CreateServerContinuation(uint32 token, uint32 methodId, char const* methodName, google::protobuf::Descriptor const* outputDescriptor)
@@ -59,8 +59,8 @@ std::function<void(ServiceBase*, uint32, google::protobuf::Message const*)> Serv
return [token, methodId, methodName, outputDescriptor](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response)
{
ASSERT(response->GetDescriptor() == outputDescriptor);
TC_LOG_DEBUG("service.protobuf", "%s Client called server method %s() %s{ %s } status %u.",
service->GetCallerInfo().c_str(), methodName, outputDescriptor->full_name().c_str(), response->ShortDebugString().c_str(), status);
TC_LOG_DEBUG("service.protobuf", "{} Client called server method {}() {}{{ {} }} status {}.",
service->GetCallerInfo(), methodName, outputDescriptor->full_name(), response->ShortDebugString(), status);
if (!status)
service->SendResponse(service->GetServiceHash(), methodId, token, response);
else