From 0920511de27c65bfe9c10900644c612b6cf96c1d Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Sat, 23 Jan 2016 18:57:29 +0100 Subject: [PATCH] lager is the default logger, we need to reverse the define flag Also make sure that configure without option does not force lager to false --- configure.ac | 2 +- include/logger.hrl | 36 +++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index f8a415088..85f65134f 100644 --- a/configure.ac +++ b/configure.ac @@ -103,7 +103,7 @@ AC_ARG_ENABLE(all, [AC_HELP_STRING([--enable-all], [same as --enable-odbc --enable-mysql --enable-pgsql --enable-sqlite --enable-pam --enable-zlib --enable-riak --enable-redis --enable-elixir --enable-iconv --enable-debug --enable-lager --enable-tools (useful for Dialyzer checks, default: no)])], [case "${enableval}" in yes) odbc=true mysql=true pgsql=true sqlite=true pam=true zlib=true riak=true redis=true elixir=true iconv=true debug=true lager=true tools=true ;; - no) odbc=false mysql=false pgsql=false sqlite=false pam=false zlib=false riak=false redis=false elixir=false iconv=false debug=false lager=false tools=false ;; + no) odbc=false mysql=false pgsql=false sqlite=false pam=false zlib=false riak=false redis=false elixir=false iconv=false debug=false tools=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;; esac],[]) diff --git a/include/logger.hrl b/include/logger.hrl index 3accc56ab..b800cd0d5 100644 --- a/include/logger.hrl +++ b/include/logger.hrl @@ -19,7 +19,25 @@ %%%---------------------------------------------------------------------- -define(PRINT(Format, Args), io:format(Format, Args)). --ifdef(LAGER). +-ifdef(P1LOGGER). + +-define(DEBUG(Format, Args), + p1_logger:debug_msg(?MODULE, ?LINE, Format, Args)). + +-define(INFO_MSG(Format, Args), + p1_logger:info_msg(?MODULE, ?LINE, Format, Args)). + +-define(WARNING_MSG(Format, Args), + p1_logger:warning_msg(?MODULE, ?LINE, Format, Args)). + +-define(ERROR_MSG(Format, Args), + p1_logger:error_msg(?MODULE, ?LINE, Format, Args)). + +-define(CRITICAL_MSG(Format, Args), + p1_logger:critical_msg(?MODULE, ?LINE, Format, Args)). + +-else. + -compile([{parse_transform, lager_transform}]). -define(DEBUG(Format, Args), @@ -37,20 +55,4 @@ -define(CRITICAL_MSG(Format, Args), lager:critical(Format, Args)). --else. - --define(DEBUG(Format, Args), - p1_logger:debug_msg(?MODULE, ?LINE, Format, Args)). - --define(INFO_MSG(Format, Args), - p1_logger:info_msg(?MODULE, ?LINE, Format, Args)). - --define(WARNING_MSG(Format, Args), - p1_logger:warning_msg(?MODULE, ?LINE, Format, Args)). - --define(ERROR_MSG(Format, Args), - p1_logger:error_msg(?MODULE, ?LINE, Format, Args)). - --define(CRITICAL_MSG(Format, Args), - p1_logger:critical_msg(?MODULE, ?LINE, Format, Args)). -endif.