1234567891011121314151617181920212223242526272829303132333435 |
- --[[
- Descripttion:客户端埋点日志工具文件
- version:
- Author: Neo,Huang
- Date: 2021-08-24 19:40:15
- LastEditors: Neo,Huang
- LastEditTime: 2022-07-26 15:21:52
- --]]
- local nodeMgr = require "nodeMgr"
- local timeUtil = require "utils.timeUtil"
- local root = {}
- -- 获取客户端写日志服务地址
- function root.get_log_service_addr()
- if root.logAddr then
- return root.logAddr
- end
- root.logAddr = nodeMgr.query_node_service_addr("resource", ".client_log")
- return root.logAddr
- end
- function root.writeClientLog(...)
- local addr = root.get_log_service_addr()
- local logFile = string.format("client-%s", timeUtil.toDate())
- nodeMgr.send("resource", addr, "writeLog", logFile, ...)
- end
- function root.writeClientLog2(...)
- local addr = root.get_log_service_addr()
- local logFile = string.format("client2-%s", timeUtil.toDate())
- nodeMgr.send("resource", addr, "writeLog", logFile, ...)
- end
- return root
|