AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available])
fi
+# dlog
+PKG_CHECK_EXISTS([dlog], [have_dlog="yes"], [have_dlog="no"])
+AC_MSG_CHECKING([Have dlog logger])
+AC_MSG_RESULT([${have_dlog}])
+if test "x${have_dlog}" = "xyes"; then
+ AC_DEFINE([HAVE_DLOG], [1], [Define to 1 if you have dlog])
+fi
+
AM_CONDITIONAL([HAVE_WAYLAND], [test "x${have_wayland}" = "xyes"])
AM_CONDITIONAL([HAVE_WAYLAND_TBM], [test "x${have_wayland_tbm}" = "xyes"])
AM_CONDITIONAL([HAVE_HWC], [test "x${have_hwc}" = "xyes"])
BuildRequires: eet-tools
BuildRequires: pkgconfig(dbus-1)
+BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(ecore-evas)
BuildRequires: pkgconfig(ecore-file)
endif
-src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ $(TTRACE_CFLAGS)
+src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DEFL_BETA_API_SUPPORT -DEFL_EO_API_SUPPORT -DE_LOGGING=1 @WAYLAND_CFLAGS@ $(TTRACE_CFLAGS) $(DLOG_CFLAGS)
if HAVE_WAYLAND_TBM
src_bin_enlightenment_CPPFLAGS += @WAYLAND_TBM_CFLAGS@ @ECORE_DRM_CFLAGS@
endif
$(enlightenment_src)
src_bin_enlightenment_LDFLAGS = -export-dynamic
-src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm @SHM_OPEN_LIBS@ $(TTRACE_LIBS)
+src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ @WAYLAND_LIBS@ -lm @SHM_OPEN_LIBS@ $(TTRACE_LIBS) $(DLOG_LIBS)
if HAVE_WAYLAND_TBM
src_bin_enlightenment_LDADD += @WAYLAND_TBM_LIBS@ @ECORE_DRM_LIBS@
endif
}
}
+#ifdef HAVE_DLOG
+static void
+_e_info_client_proc_dlog_switch(int argc, char **argv)
+{
+ uint32_t onoff;
+
+ EINA_SAFETY_ON_FALSE_RETURN(argc == 3);
+ EINA_SAFETY_ON_NULL_RETURN(argv[2]);
+
+ onoff = atoi(argv[2]);
+ if ((onoff == 1) || (onoff == 0))
+ {
+
+ if (!_e_info_client_eldbus_message_with_args("dlog", NULL, "i", onoff))
+ {
+ printf("Error to switch %s logging system using dlog logging.", onoff?"on":"off");
+ return;
+ }
+ if (onoff)
+ printf("Now you can try to track enlightenment log with dlog logging system.\n"
+ "Track dlog with LOGTAG \"E20\" ex) dlogutil E20\n");
+ else
+ printf("Logging of enlightenment with dlog is disabled.\n");
+ }
+}
+#endif
+
static void
_cb_window_prop_get(const Eldbus_Message *msg)
{
"Set eina-log path in runtime",
_e_info_client_proc_eina_log_path
},
+#ifdef HAVE_DLOG
+ {
+ "dlog",
+ "[on:1,off:0]",
+ "Logging using dlog system (on:1, off:0)",
+ _e_info_client_proc_dlog_switch
+ },
+#endif
{
"prop", "[id]",
"Print window infomation",
return reply;
}
+#ifdef HAVE_DLOG
+static Eldbus_Message *
+_e_info_server_cb_dlog_switch(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ uint32_t onoff;
+
+ if (!eldbus_message_arguments_get(msg, "i", &onoff))
+ {
+ ERR("Error getting arguments.");
+ return reply;
+ }
+
+ if ((onoff == 1) || (onoff == 0))
+ e_log_dlog_enable(onoff);
+
+ return reply;
+}
+#endif
+
static Eldbus_Message *
_e_info_server_cb_rotation_query(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
{ "dump_topvwins", ELDBUS_ARGS({"s", "directory"}), NULL, _e_info_server_cb_topvwins_dump, 0 },
{ "eina_log_levels", ELDBUS_ARGS({"s", "eina log levels"}), NULL, _e_info_server_cb_eina_log_levels, 0 },
{ "eina_log_path", ELDBUS_ARGS({"s", "eina log path"}), NULL, _e_info_server_cb_eina_log_path, 0 },
+#ifdef HAVE_DLOG
+ { "dlog", ELDBUS_ARGS({"i", "using dlog"}), NULL, _e_info_server_cb_dlog_switch, 0},
+#endif
{ "get_window_prop", ELDBUS_ARGS({"us", "query_mode_value"}), ELDBUS_ARGS({"a(ss)", "array_of_ec"}), _e_info_server_cb_window_prop_get, 0},
{ "get_connected_clients", NULL, ELDBUS_ARGS({"a(ss)", "array of ec"}), _e_info_server_cb_connected_clients_get, 0 },
{ "rotation_query", ELDBUS_ARGS({"i", "query_rotation"}), NULL, _e_info_server_cb_rotation_query, 0},
"DBG",
};
+#ifdef HAVE_DLOG
+static Eina_Bool _dlog_enabled = EINA_FALSE;
+#endif
+
static void
_e_log_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc EINA_UNUSED, int line, const char *fmt, void *data EINA_UNUSED, va_list args)
{
const char *color;
+#ifdef HAVE_DLOG
+ if (_dlog_enabled)
+ {
+ int log_level;
+ const char buf[512];
+ char tmp_log_level[512];
+
+ switch (level)
+ {
+ case EINA_LOG_LEVEL_CRITICAL:
+ log_level = DLOG_FATAL;
+ strcpy(tmp_log_level, "FATAL");
+ break;
+ case EINA_LOG_LEVEL_ERR:
+ log_level = DLOG_ERROR;
+ strcpy(tmp_log_level, "ERROR");
+ break;
+ case EINA_LOG_LEVEL_WARN:
+ log_level = DLOG_WARN;
+ strcpy(tmp_log_level, "WARNING");
+ break;
+ case EINA_LOG_LEVEL_INFO:
+ log_level = DLOG_INFO;
+ strcpy(tmp_log_level, "INFO");
+ break;
+ case EINA_LOG_LEVEL_DBG:
+ log_level = DLOG_DEBUG;
+ strcpy(tmp_log_level, "DEBUG");
+ break;
+ default:
+ log_level = DLOG_VERBOSE;
+ strcpy(tmp_log_level, "VERBOSE");
+ break;
+ }
+
+ vsnprintf((char *)buf, sizeof(buf), fmt, args);
+ dlog_print(log_level, LOG_TAG,
+ "%s<%s> %30.30s:%04d %s",
+ _names[level > EINA_LOG_LEVEL_DBG ? EINA_LOG_LEVEL_DBG : level],
+ d->domain_str,file, line, buf);
+ return;
+ }
+#endif
color = eina_log_level_color_get(level);
+
fprintf(stdout,
"%s%s<" EINA_COLOR_RESET "%s%s>" EINA_COLOR_RESET "%30.30s:%04d" EINA_COLOR_RESET " ",
color, _names[level > EINA_LOG_LEVEL_DBG ? EINA_LOG_LEVEL_DBG : level],
putc('\n', stdout);
}
+#ifdef HAVE_DLOG
+EINTERN void
+e_log_dlog_enable(Eina_Bool enable)
+{
+ if (_dlog_enabled != enable)
+ _dlog_enabled = enable;
+}
+#endif
+
EINTERN int
e_log_init(void)
{
e_log_dom = eina_log_domain_register("e", EINA_COLOR_WHITE);
eina_log_print_cb_set(_e_log_cb, NULL);
eina_log_domain_level_set("e", 3);
+
+#ifdef HAVE_DLOG
+ if (getenv("E_LOG_DLOG_ENABLE"))
+ _dlog_enabled = EINA_TRUE;
+#endif
+
return 1;
}
#ifndef E_LOG_H
#define E_LOG_H
+#ifdef HAVE_DLOG
+# include <dlog.h>
+# ifdef LOG_TAG
+# undef LOG_TAG
+# endif
+# define LOG_TAG "E20"
+#endif
#ifdef E_LOGGING
#undef DBG
extern E_API int e_log_dom;
+#ifdef HAVE_DLOG
+EINTERN void e_log_dlog_enable(Eina_Bool enable);
+#endif
+
EINTERN int e_log_init(void);
EINTERN int e_log_shutdown(void);
#else