From 6a75d6c87e197e844ff907921ef9b3378ada3577 Mon Sep 17 00:00:00 2001 From: zhaobangyu <763098346@QQ.com> Date: Sun, 8 Oct 2023 11:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/driver/redis.lua | 2 +- script/kernel/protobuf_mgr.lua | 2 +- script/network/net_client.lua | 2 +- server/cache/cache_gm.lua | 2 +- server/center/gm_mgr.lua | 14 +++++++------- server/robot/accord_mgr.lua | 2 +- server/robot/dao/accord_dao.lua | 8 ++++---- server/robot/module/session.lua | 6 +++--- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/script/driver/redis.lua b/script/driver/redis.lua index 62451172..199c469f 100644 --- a/script/driver/redis.lua +++ b/script/driver/redis.lua @@ -199,7 +199,7 @@ function RedisDB:check_clusters() end local ok, res = self:commit(socket, "cluster", "slots") if not ok then - log_err("[RedisDB][check_clusters] load cluster slots failed! because: %s", res) + log_err("[RedisDB][check_clusters] load cluster slots failed! because: {}", res) return end for i, info in pairs(res) do diff --git a/script/kernel/protobuf_mgr.lua b/script/kernel/protobuf_mgr.lua index a7b3e03d..d8c70d31 100644 --- a/script/kernel/protobuf_mgr.lua +++ b/script/kernel/protobuf_mgr.lua @@ -68,7 +68,7 @@ function ProtobufMgr:enum(ename, ekey) local value = emun[ekey] if not value then local info = dgetinfo(2, "S") - log_warn("[ProtobufMgr][enum] %s.%s not defined! source({}:{})", ename, ekey, info.short_src, info.linedefined) + log_warn("[ProtobufMgr][enum] {}.{} not defined! source({}:{})", ename, ekey, info.short_src, info.linedefined) return end return value diff --git a/script/network/net_client.lua b/script/network/net_client.lua index 70b8ebb3..61a10eef 100644 --- a/script/network/net_client.lua +++ b/script/network/net_client.lua @@ -117,7 +117,7 @@ function NetClient:write(cmd_id, data, type, session_id, flag) -- call lbus local send_len = self.socket.call_pb(session_id, cmd_id, flag, type, 0, data) if send_len < 0 then - log_err("[NetClient][write] call_pb failed! code:%s", send_len) + log_err("[NetClient][write] call_pb failed! code:{}", send_len) return false end --proxy_agent:statistics("on_proto_send", cmd_id, send_len) diff --git a/server/cache/cache_gm.lua b/server/cache/cache_gm.lua index a5f162be..9de6245a 100644 --- a/server/cache/cache_gm.lua +++ b/server/cache/cache_gm.lua @@ -92,7 +92,7 @@ function CacheGM:signed(player_id) --加载open_id local code, doc = cache_mgr:load_document("player", player_id) if qfailed(code) then - log_err("[CacheGM][signed] load_document failed! player_id=%s", player_id) + log_err("[CacheGM][signed] load_document failed! player_id={}", player_id) return "failed" end local open_id = doc:get_datas().open_id diff --git a/server/center/gm_mgr.lua b/server/center/gm_mgr.lua index 615af598..9e1a600d 100644 --- a/server/center/gm_mgr.lua +++ b/server/center/gm_mgr.lua @@ -134,25 +134,25 @@ end --执行gm, command:string function GM_Mgr:rpc_execute_command(command) - log_debug("[GM_Mgr][rpc_execute_command] command: %s", command) + log_debug("[GM_Mgr][rpc_execute_command] command: {}", command) local res = self:exec_command(command) return SUCCESS, res end --执行gm, message: table function GM_Mgr:rpc_execute_message(message) - log_debug("[GM_Mgr][rpc_execute_message] message: %s", message) + log_debug("[GM_Mgr][rpc_execute_message] message: {}", message) local res = self:exec_message(message) return SUCCESS, res end function GM_Mgr:on_service_close(id, name) - log_debug("[GM_Mgr][on_service_close] node: %s-%s", name, id) + log_debug("[GM_Mgr][on_service_close] node: {}-{}", name, id) self.monitors[id] = nil end function GM_Mgr:on_service_ready(id, name, info) - log_debug("[GM_Mgr][on_service_ready] node: %s-%s, info: %s", name, id, info) + log_debug("[GM_Mgr][on_service_ready] node: {}-{}, info: {}", name, id, info) self.monitors[id] = sformat("%s:%s", info.ip, info.port) end @@ -170,7 +170,7 @@ end --monitor拉取 function GM_Mgr:on_monitors(url, params) - log_debug("[GM_Mgr][on_monitors] body: %s", params) + log_debug("[GM_Mgr][on_monitors] body: {}", params) local nodes = {} for _, addr in pairs(self.monitors) do tinsert(nodes, { text = addr, tag = "log" }) @@ -180,13 +180,13 @@ end --后台GM调用,字符串格式 function GM_Mgr:on_command(url, body) - log_debug("[GM_Mgr][on_command] body: %s", body) + log_debug("[GM_Mgr][on_command] body: {}", body) return self:exec_command(body.data) end --后台GM调用,table格式 function GM_Mgr:on_message(url, body) - log_debug("[GM_Mgr][on_message] body: %s", body) + log_debug("[GM_Mgr][on_message] body: {}", body) return self:exec_message(body.data) end diff --git a/server/robot/accord_mgr.lua b/server/robot/accord_mgr.lua index 46c8bb20..86baebc0 100644 --- a/server/robot/accord_mgr.lua +++ b/server/robot/accord_mgr.lua @@ -142,7 +142,7 @@ end -- 拉取日志 function AccordMgr:on_message(url, params) - -- log_debug("[AccordMgr][on_message] open_id: %s", params.open_id) + -- log_debug("[AccordMgr][on_message] open_id: {}", params.open_id) return robot_mgr:get_accord_message(params.open_id) end diff --git a/server/robot/dao/accord_dao.lua b/server/robot/dao/accord_dao.lua index f22ebcaa..e7b68c3d 100644 --- a/server/robot/dao/accord_dao.lua +++ b/server/robot/dao/accord_dao.lua @@ -14,7 +14,7 @@ end function AccordDao:load_data(document) local code, data = mongo_mgr:find(1, mrandom(), document, {}) if code ~= SUCCESS then - log_debug("[AccordDao][load_data] document:%s code:%s", document, code) + log_debug("[AccordDao][load_data] document:{} code:{}", document, code) return false, code end return true, data @@ -24,7 +24,7 @@ end function AccordDao:insert(document, data) local code, res = mongo_mgr:insert(1, mrandom(), document, data) if code ~= SUCCESS then - log_debug("[AccordDao][insert] document:%s code:%s", document, code) + log_debug("[AccordDao][insert] document:{} code:{}", document, code) return false end return true @@ -35,7 +35,7 @@ function AccordDao:update(document, data) local udata = { ["$set"] = data } local code, res = mongo_mgr:update(1, mrandom(), document, udata, { id = data.id }) if code ~= SUCCESS then - log_debug("[AccordDao][update] document:%s code:%s", document, code) + log_debug("[AccordDao][update] document:{} code:{}", document, code) return false end return true @@ -45,7 +45,7 @@ end function AccordDao:delete(document, id) local code, res = mongo_mgr:delete(1, mrandom(), document, {id=id}) if code ~= SUCCESS then - log_debug("[AccordDao][delete] document:%s code:%s", document, code) + log_debug("[AccordDao][delete] document:{} code:{}", document, code) return false end return true diff --git a/server/robot/module/session.lua b/server/robot/module/session.lua index e1fee869..628b803d 100644 --- a/server/robot/module/session.lua +++ b/server/robot/module/session.lua @@ -33,12 +33,12 @@ end -- 连接成回调 function SessionModule:on_socket_connect(client) - log_debug("[SessionModule][on_socket_connect] %s", self:get_title()) + log_debug("[SessionModule][on_socket_connect] {}", self:get_title()) end -- 连接关闭回调 function SessionModule:on_socket_error(client, token, err) - log_debug("[SessionModule][on_socket_error] %s, err:%s", self:get_title(), err) + log_debug("[SessionModule][on_socket_error] {}, err:{}", self:get_title(), err) end --消息回调 @@ -51,7 +51,7 @@ function SessionModule:on_socket_rpc(client, cmd_id, body) local doer = self.cmd_doers[cmd_id] if not doer then self:push_message(cmd_id, body) - log_warn("[SessionModule][on_socket_rpc] cmd %s hasn't register doer!, msg=%s", cmd_id, body) + log_warn("[SessionModule][on_socket_rpc] cmd {} hasn't register doer!, msg={}", cmd_id, body) return end local module, handler = tunpack(doer)