diff --git a/extend/lualog/lualog/lualog.cpp b/extend/lualog/lualog/lualog.cpp index 001b93b0..6a2a68c1 100644 --- a/extend/lualog/lualog/lualog.cpp +++ b/extend/lualog/lualog/lualog.cpp @@ -43,7 +43,7 @@ namespace logger { } template - int tformat(lua_State* L, log_level lvl, cstring& tag, cstring& feature, int flag, cstring& vfmt, std::index_sequence&&) { + int tformat(lua_State* L, log_level lvl, cstring& tag, cstring& feature, int flag, vstring vfmt, std::index_sequence&&) { try { auto msg = fmt::format(vfmt, read_args(L, flag, integers + 6)...); return zformat(L, lvl, tag, feature, msg); @@ -71,10 +71,10 @@ namespace logger { size_t flag = lua_tointeger(L, 2); sstring tag = lua_to_native(L, 3); sstring feature = lua_to_native(L, 4); - sstring vfmt = lua_to_native(L, 5); + vstring vfmt = lua_to_native(L, 5); int arg_num = lua_gettop(L) - 5; switch (arg_num) { - case 0: return zformat(L, lvl, tag, feature, vfmt); + case 0: return zformat(L, lvl, tag, feature, string(vfmt.data(), vfmt.size())); case 1: return tformat(L, lvl, tag, feature, flag, vfmt, make_index_sequence<1>{}); case 2: return tformat(L, lvl, tag, feature, flag, vfmt, make_index_sequence<2>{}); case 3: return tformat(L, lvl, tag, feature, flag, vfmt, make_index_sequence<3>{});