From a4cad6f0bff25dabac8ed63147e9236d3be5ff88 Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Fri, 21 Oct 2016 13:59:12 +0900 Subject: [PATCH] e_info_server: getenv E_INFO_TRACE_FILE in init() and trace protocol logs from boot Change-Id: I08e35c1a00f93d35c4a0b5420de8036432dd915f Signed-off-by: Duna Oh --- src/bin/e_info_server.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/bin/e_info_server.c b/src/bin/e_info_server.c index ab98a83..da65235 100644 --- a/src/bin/e_info_server.c +++ b/src/bin/e_info_server.c @@ -2256,6 +2256,28 @@ e_info_server_protocol_rule_path_init(char *rule_path) return EINA_TRUE; } +Eina_Bool +e_info_server_protocol_trace_path_init(char *trace_path) +{ + if (!trace_path || strlen(trace_path) <= 0) + return EINA_FALSE; + + INF("%s: trace_path : %s\n", __func__, trace_path); + + log_fp_ptrace = fopen(trace_path, "a"); + + if (!log_fp_ptrace) + { + ERR("failed: open file(%s)\n", trace_path); + return EINA_FALSE; + } + + setvbuf(log_fp_ptrace, NULL, _IOLBF, 512); + wl_debug_server_debug_func_set((wl_server_debug_func_ptr)_e_info_server_protocol_debug_func); + + return EINA_TRUE; +} + static Eina_Bool _e_info_server_dbus_init(void *data EINA_UNUSED) { @@ -2279,6 +2301,7 @@ _e_info_server_dbus_init(void *data EINA_UNUSED) e_info_protocol_init(); e_info_server_protocol_rule_path_init(getenv("E_INFO_RULE_FILE")); + e_info_server_protocol_trace_path_init(getenv("E_INFO_TRACE_FILE")); return ECORE_CALLBACK_CANCEL; -- 2.7.4