mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
Logging cleanup (#69)
* Mac OS X 10.6 & More C++03 Support * Fix SDL2 options.txt loading for C++03 * Output/Logging Overhaul * Added StandardOut class * Renamed LOGX macros to LOG_X * Removed LogMsg macros in favor of LOG_X * Added console window for debug Windows builds * Updated Xcode Project + StandardOut.hpp + StandardOut.cpp * StandardOut_windows * Replaced the Windows #ifdefs in StandardOut with StandardOut_windows --------- Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "Util.hpp"
|
||||
|
||||
std::string Util::stringTrim(const std::string& str, const std::string& filter, bool a4, bool a5)
|
||||
@@ -43,3 +44,23 @@ std::string Util::stringTrim(const std::string& str)
|
||||
return stringTrim(str, " \t\n\r", true, true);
|
||||
}
|
||||
|
||||
std::string Util::vformat(const char *fmt, va_list argPtr)
|
||||
{
|
||||
char str[1024];
|
||||
|
||||
vsnprintf(str, sizeof(str), fmt, argPtr);
|
||||
|
||||
return std::string(str);
|
||||
}
|
||||
|
||||
std::string Util::format(const char *fmt, ...)
|
||||
{
|
||||
std::string str;
|
||||
va_list argList;
|
||||
|
||||
va_start(argList, fmt);
|
||||
str = vformat(fmt, argList);
|
||||
va_end(argList);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user