add config.logservice for user defined log service

This commit is contained in:
Cloud Wu
2015-05-30 22:17:53 +08:00
parent 24f6994b50
commit 69946d75c5
3 changed files with 4 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ struct skynet_config {
const char * module_path;
const char * bootstrap;
const char * logger;
const char * logservice;
};
#define THREAD_WORKER 0

View File

@@ -133,6 +133,7 @@ main(int argc, char *argv[]) {
config.bootstrap = optstring("bootstrap","snlua bootstrap");
config.daemon = optstring("daemon", NULL);
config.logger = optstring("logger", NULL);
config.logservice = optstring("logservice", "logger");
lua_close(L);

View File

@@ -223,9 +223,9 @@ skynet_start(struct skynet_config * config) {
skynet_timer_init();
skynet_socket_init();
struct skynet_context *ctx = skynet_context_new("logger", config->logger);
struct skynet_context *ctx = skynet_context_new(config->logservice, config->logger);
if (ctx == NULL) {
fprintf(stderr, "Can't launch logger service\n");
fprintf(stderr, "Can't launch %s service\n", config->logservice);
exit(1);
}