From: YoungHun Kim Date: Wed, 31 Oct 2018 10:37:43 +0000 (+0900) Subject: Setup log target right after starting plugin for more debugging X-Git-Tag: submit/tizen/20181106.232739^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F192193%2F3;p=platform%2Fupstream%2Fmurphy.git Setup log target right after starting plugin for more debugging - replace with printf before setup target Change-Id: I091e774092954e782694ed6fc89ebb27957977e7 --- diff --git a/src/common/log.c b/src/common/log.c index 1e32172..3b60659 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -226,6 +226,7 @@ int mrp_log_set_target(const char *name) } log_target = target; + mrp_log_info("murphyd %s start", mrp_log_get_target()); /* open any new files if we have to */ if (target == &file_target) { diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 8df12b0..293610c 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c @@ -102,10 +102,11 @@ static mrp_context_t *create_context(void) if (ctx != NULL) { ctx->daemon_bus = mrp_event_bus_get(ctx->ml, MRP_DAEMON_BUS); + printf("Success to create murphy main context\n"); return ctx; } else - mrp_log_error("Failed to create murphy main context."); + printf("Failed to create murphy main context.\n"); exit(1); } @@ -134,28 +135,28 @@ static void load_configuration(mrp_context_t *ctx) cfg = mrp_parse_cfgfile(ctx->config_file); if (cfg != NULL) { - mrp_log_info("Blacklisted plugins of any type: %s", + printf("Blacklisted plugins of any type: %s\n", ctx->blacklist_plugins ? ctx->blacklist_plugins:""); - mrp_log_info("Blacklisted builtin plugins: %s", + printf("Blacklisted builtin plugins: %s\n", ctx->blacklist_builtin ? ctx->blacklist_builtin:""); - mrp_log_info("Blacklisted dynamic plugins: %s", + printf("Blacklisted dynamic plugins: %s\n", ctx->blacklist_dynamic ? ctx->blacklist_dynamic:""); - mrp_log_info("Whitelisted plugins of any type: %s", + printf("Whitelisted plugins of any type: %s\n", ctx->whitelist_plugins ? ctx->whitelist_plugins:""); - mrp_log_info("Whitelisted builtin plugins: %s", + printf("Whitelisted builtin plugins: %s\n", ctx->whitelist_builtin ? ctx->whitelist_builtin:""); - mrp_log_info("Whitelisted dynamic plugins: %s", + printf("Whitelisted dynamic plugins: %s\n", ctx->whitelist_dynamic ? ctx->whitelist_dynamic:""); mrp_block_blacklisted_plugins(ctx); if (!mrp_exec_cfgfile(ctx, cfg)) { - mrp_log_error("Failed to execute configuration."); + printf("Failed to execute configuration.\n"); exit(1); } } else { - mrp_log_error("Failed to parse configuration file '%s'.", + printf("Failed to parse configuration file '%s'.\n", ctx->config_file); exit(1); } @@ -189,9 +190,9 @@ static void start_plugins(mrp_context_t *ctx) emit_daemon_event(ctx, DAEMON_EVENT_STARTING); if (mrp_start_plugins(ctx)) - mrp_log_info("Successfully started all loaded plugins."); + printf("Successfully started all loaded plugins.\n"); else { - mrp_log_error("Some plugins failed to start."); + printf("Some plugins failed to start.\n"); exit(1); } } @@ -288,9 +289,9 @@ int main(int argc, char *argv[], char *envp[]) parse_cmdline(ctx, argc, argv, envp); load_configuration(ctx); start_plugins(ctx); + setup_logging(ctx); load_ruleset(ctx); prepare_ruleset(ctx); - setup_logging(ctx); set_linebuffered(stdout); set_nonbuffered(stderr); daemonize(ctx);