mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
remove redis config file, use table directly
This commit is contained in:
@@ -9,4 +9,3 @@ standalone = "0.0.0.0:2013"
|
||||
luaservice = root.."service/?.lua;"..root.."test/?.lua;"..root.."examples/?.lua"
|
||||
snax = root.."examples/?.lua;"..root.."test/?.lua"
|
||||
cpath = root.."cservice/?.so"
|
||||
redis = root .. "examples/redisconf"
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
local log_level_desc = {
|
||||
[0] = "NOLOG",
|
||||
[10] = "DEBUG",
|
||||
[20] = "INFO",
|
||||
[30] = "WARNING",
|
||||
[40] = "ERROR",
|
||||
[50] = "CRITICAL",
|
||||
[60] = "FATAL",
|
||||
}
|
||||
|
||||
--
|
||||
-- log object
|
||||
--
|
||||
function log_format(self)
|
||||
if self.tags and next(self.tags) then
|
||||
return string.format("[%s %s *%s*] [%s]%s %s", self.timestamp,self.level,self.name,table.concat(self.tags, ","),self.src,self.msg)
|
||||
else
|
||||
return string.format("[%s %s *%s*]%s %s", self.timestamp,self.level,self.name,self.src,self.msg)
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- end log object
|
||||
--
|
||||
|
||||
local function log(name, modname, level, timestamp, msg, src, tags)
|
||||
print(log_format {
|
||||
name = name,
|
||||
modname = modname,
|
||||
level = log_level_desc[level],
|
||||
timestamp = timestamp,
|
||||
msg = msg,
|
||||
src = src or '',
|
||||
tags = tags,
|
||||
})
|
||||
end
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("lua",function(session, from, ...)
|
||||
log(...)
|
||||
end)
|
||||
skynet.register ".lualog"
|
||||
end)
|
||||
@@ -4,10 +4,7 @@ skynet.start(function()
|
||||
print("Log server start")
|
||||
local service = skynet.newservice("service_mgr")
|
||||
skynet.monitor "simplemonitor"
|
||||
local lualog = skynet.newservice("lualog")
|
||||
local console = skynet.newservice("console")
|
||||
local log = skynet.newservice("globallog")
|
||||
-- skynet.launch("snlua","testgroup_c 11 1")
|
||||
skynet.exit()
|
||||
end)
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
main = { host = "127.0.0.1" , port = 6379 , db = 0 }
|
||||
|
||||
Reference in New Issue
Block a user