mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Trinity
|
||||
|
||||
void Assert(char const* file, int line, char const* function, std::string debugInfo, char const* message)
|
||||
{
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + debugInfo + '\n';
|
||||
std::string formattedMessage = StringFormat("\n{}:{} in {} ASSERTION FAILED:\n {}\n", file, line, function, message) + debugInfo + '\n';
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
@@ -83,7 +83,7 @@ void Assert(char const* file, int line, char const* function, std::string debugI
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s ASSERTION FAILED:\n %s\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
|
||||
std::string formattedMessage = StringFormat("\n{}:{} in {} ASSERTION FAILED:\n {}\n", file, line, function, message) + FormatAssertionMessage(format, args) + '\n' + debugInfo + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
@@ -97,7 +97,7 @@ void Fatal(char const* file, int line, char const* function, char const* message
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
std::string formattedMessage = StringFormat("\n{}:{} in {} FATAL ERROR:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
@@ -109,7 +109,7 @@ void Fatal(char const* file, int line, char const* function, char const* message
|
||||
|
||||
void Error(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s ERROR:\n %s\n", file, line, function, message);
|
||||
std::string formattedMessage = StringFormat("\n{}:{} in {} ERROR:\n {}\n", file, line, function, message);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
@@ -123,7 +123,7 @@ void Warning(char const* file, int line, char const* function, char const* messa
|
||||
|
||||
void Abort(char const* file, int line, char const* function)
|
||||
{
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s ABORTED.\n", file, line, function);
|
||||
std::string formattedMessage = StringFormat("\n{}:{} in {} ABORTED.\n", file, line, function);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
@@ -134,7 +134,7 @@ void Abort(char const* file, int line, char const* function, char const* message
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
|
||||
std::string formattedMessage = StringFormat("\n%s:%i in %s ABORTED:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
std::string formattedMessage = StringFormat("\n{}:{} in {} ABORTED:\n", file, line, function) + FormatAssertionMessage(message, args) + '\n';
|
||||
va_end(args);
|
||||
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
@@ -146,7 +146,7 @@ void Abort(char const* file, int line, char const* function, char const* message
|
||||
void AbortHandler(int sigval)
|
||||
{
|
||||
// nothing useful to log here, no way to pass args
|
||||
std::string formattedMessage = StringFormat("Caught signal %i\n", sigval);
|
||||
std::string formattedMessage = StringFormat("Caught signal {}\n", sigval);
|
||||
fprintf(stderr, "%s", formattedMessage.c_str());
|
||||
fflush(stderr);
|
||||
Crash(formattedMessage.c_str());
|
||||
|
||||
Reference in New Issue
Block a user