diff --git a/.gitmodules b/.gitmodules index b54a97b..6293066 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "deps/json"] path = deps/json url = https://github.com/nlohmann/json +[submodule "deps/fmt"] + path = deps/fmt + url = https://github.com/fmtlib/fmt diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 4e556b0..6167b39 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -7,3 +7,4 @@ include_directories("${PROJECT_SOURCE_DIR}/deps") add_subdirectory("${PROJECT_SOURCE_DIR}/deps/commandline") add_subdirectory("${PROJECT_SOURCE_DIR}/deps/sol2") +add_subdirectory("${PROJECT_SOURCE_DIR}/deps/fmt") diff --git a/deps/fmt b/deps/fmt new file mode 160000 index 0000000..17dda58 --- /dev/null +++ b/deps/fmt @@ -0,0 +1 @@ +Subproject commit 17dda58391fba627a56482f5d2652a396619bc26 diff --git a/include/Common.h b/include/Common.h index 76640aa..289b81e 100644 --- a/include/Common.h +++ b/include/Common.h @@ -7,12 +7,13 @@ extern TSentry Sentry; #include #include #include +#include +#include #include #include #include #include #include -#include #include "Compat.h" @@ -208,6 +209,11 @@ void RegisterThread(const std::string& str); #define beammp_trace(x) #endif // defined(DEBUG) +#define beammp_errorf(_format, _args) beammp_error(fmt::format(_format, _args)) +#define beammp_infof(_format, _args) beammp_info(fmt::format(_format, _args)) +#define beammp_warnf(_format, _args) beammp_warn(fmt::format(_format, _args)) +#define beammp_tracef(_format, _args) beammp_trace(fmt::format(_format, _args)) + void LogChatMessage(const std::string& name, int id, const std::string& msg); #define Biggest 30000