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
This commit is contained in:
Gustavo Sverzut Barbieri 2012-06-17 18:41:23 +00:00
parent 1a15b87491
commit 329c558c5d
1 changed files with 16 additions and 0 deletions

View File

@ -32,6 +32,22 @@ PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}])
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
with_max_log_level="<unset>"
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