From f84fe84b964a2d947b5d7b6c0cb6d811d3a6c85a Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Sun, 12 Jun 2016 13:48:53 +0800 Subject: [PATCH] update userlog --- examples/userlog.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/userlog.lua b/examples/userlog.lua index 55aa0952..3a8c5d22 100644 --- a/examples/userlog.lua +++ b/examples/userlog.lua @@ -6,7 +6,17 @@ skynet.register_protocol { id = skynet.PTYPE_TEXT, unpack = skynet.tostring, dispatch = function(_, address, msg) - print(string.format("%x(%.2f): %s", address, skynet.time(), msg)) + print(string.format(":%08x(%.2f): %s", address, skynet.time(), msg)) + end +} + +skynet.register_protocol { + name = "SYSTEM", + id = skynet.PTYPE_SYSTEM, + unpack = function(...) return ... end, + dispatch = function() + -- reopen signal + print("SIGHUP") end }