From b805440943bf7979862aa0959b577be1b0f895fd Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Mon, 25 Sep 2023 14:09:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/lualog/lualog/lualog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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>{});