From 4727ed20846bb3d1a9eabb27aaaa9c5524129556 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Mon, 24 Sep 2018 21:33:39 +0100 Subject: Add a formatting function for Vector3 (#4282) * Vector3: Add custom fmt compatible formatter. * cLuaState: Add fmt version of ApiParamError * Use vector formatting in manual bindings * Always log vectors with FLOG --- src/Bindings/LuaState.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Bindings/LuaState.cpp') diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 7ec099982..c1e71bd5c 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -2004,7 +2004,7 @@ void cLuaState::LogStackTrace(lua_State * a_LuaState, int a_StartingDepth) -int cLuaState::ApiParamError(const char * a_MsgFormat, fmt::ArgList argp) +int cLuaState::ApiParamError(fmt::StringRef a_Msg) { // Retrieve current function name lua_Debug entry; @@ -2012,8 +2012,7 @@ int cLuaState::ApiParamError(const char * a_MsgFormat, fmt::ArgList argp) VERIFY(lua_getinfo(m_LuaState, "n", &entry)); // Compose the error message: - AString msg = Printf(a_MsgFormat, argp); - AString errorMsg = fmt::format("{0}: {1}", (entry.name != nullptr) ? entry.name : "", msg); + AString errorMsg = fmt::format("{0}: {1}", (entry.name != nullptr) ? entry.name : "", a_Msg); // Log everything into the console: LOGWARNING("%s", errorMsg.c_str()); -- cgit v1.2.3