register logger name in framework, see #909

This commit is contained in:
Cloud Wu
2018-10-21 13:21:51 +08:00
parent b4752f2394
commit 8a3a0c1b71
3 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
local skynet = require "skynet"
require "skynet.manager"
-- register protocol text before skynet.start would be better.
skynet.register_protocol {
name = "text",
id = skynet.PTYPE_TEXT,
@@ -21,5 +22,4 @@ skynet.register_protocol {
}
skynet.start(function()
skynet.register ".logger"
end)

View File

@@ -65,7 +65,6 @@ logger_init(struct logger * inst, struct skynet_context *ctx, const char * parm)
}
if (inst->handle) {
skynet_callback(ctx, inst, logger_cb);
skynet_command(ctx, "REG", ".logger");
return 0;
}
return 1;

View File

@@ -272,6 +272,8 @@ skynet_start(struct skynet_config * config) {
exit(1);
}
skynet_handle_namehandle(skynet_context_handle(ctx), "logger");
bootstrap(ctx, config->bootstrap);
start(config->thread);