From 329c558c5d9d77d59034a73f4a898ef0187b0dcd Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Sun, 17 Jun 2012 18:41:23 +0000 Subject: [PATCH] performance: allow limiting the maximum log level at compile time. Although eina_log is not that harmful, allowing the user to remove debug/info messages for production is good, it reduces the overhead and also allows removing the strings from the final binary. I'd recommend production builds with: ./configure --with-maximum-log-level=2 SVN revision: 72311 --- configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/configure.ac b/configure.ac index bd519bba..5226202c 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,22 @@ PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}]) EFL_WITH_BIN([edje], [edje-cc], [edje_cc]) +with_max_log_level="" +AC_ARG_WITH(maximum-log-level, + [AC_HELP_STRING([--with-maximum-log-level=NUMBER], + [limit terminology log level to the given number, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])], + [ + if test "x${withval}" != "xno"; then + if echo "${withval}" | grep -E '^[[0-9]]+$' >/dev/null 2>/dev/null; then + AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}]) + AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.]) + with_max_log_level="${withval}" + else + AC_MSG_ERROR([--with-maximum-log-level takes a decimal number, got "${withval}" instead.]) + fi + fi + ], [:]) + AC_CONFIG_FILES([ Makefile src/Makefile