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:
Brent
2023-08-28 02:55:41 -05:00
committed by GitHub
parent f7915a1dab
commit 5c1ea03747
43 changed files with 326 additions and 207 deletions

View File

@@ -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;
}