You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/07/06 14:25:51 UTC
svn commit: r1143375 - in /couchdb/trunk/src/couchdb: couch_db.hrl
couch_log.erl
Author: fdmanana
Date: Wed Jul 6 12:25:50 2011
New Revision: 1143375
URL: http://svn.apache.org/viewvc?rev=1143375&view=rev
Log:
Redefine logging macros
With these macro definitions we don't evaluate the arguments
if the corresponding log level is not enabled.
This behaviour was accidently removed by the patch from
COUCHDB-1054.
Modified:
couchdb/trunk/src/couchdb/couch_db.hrl
couchdb/trunk/src/couchdb/couch_log.erl
Modified: couchdb/trunk/src/couchdb/couch_db.hrl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db.hrl?rev=1143375&r1=1143374&r2=1143375&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db.hrl (original)
+++ couchdb/trunk/src/couchdb/couch_db.hrl Wed Jul 6 12:25:50 2011
@@ -36,8 +36,20 @@
-define(DEFAULT_ATTACHMENT_CONTENT_TYPE, <<"application/octet-stream">>).
--define(LOG_DEBUG(Format, Args), couch_log:debug(Format, Args)).
--define(LOG_INFO(Format, Args), couch_log:info(Format, Args)).
+-define(LOG_DEBUG(Format, Args),
+ case couch_log:debug_on() of
+ true ->
+ couch_log:debug(Format, Args);
+ false -> ok
+ end).
+
+-define(LOG_INFO(Format, Args),
+ case couch_log:info_on() of
+ true ->
+ couch_log:info(Format, Args);
+ false -> ok
+ end).
+
-define(LOG_ERROR(Format, Args), couch_log:error(Format, Args)).
% Tree::term() is really a tree(), but we don't want to require R13B04 yet
Modified: couchdb/trunk/src/couchdb/couch_log.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_log.erl?rev=1143375&r1=1143374&r2=1143375&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_log.erl (original)
+++ couchdb/trunk/src/couchdb/couch_log.erl Wed Jul 6 12:25:50 2011
@@ -34,22 +34,12 @@
}).
debug(Format, Args) ->
- case debug_on() of
- false ->
- ok;
- true ->
- {ConsoleMsg, FileMsg} = get_log_messages(self(), debug, Format, Args),
- gen_event:sync_notify(error_logger, {couch_debug, ConsoleMsg, FileMsg})
- end.
+ {ConsoleMsg, FileMsg} = get_log_messages(self(), debug, Format, Args),
+ gen_event:sync_notify(error_logger, {couch_debug, ConsoleMsg, FileMsg}).
info(Format, Args) ->
- case info_on() of
- false ->
- ok;
- true ->
- {ConsoleMsg, FileMsg} = get_log_messages(self(), info, Format, Args),
- gen_event:sync_notify(error_logger, {couch_info, ConsoleMsg, FileMsg})
- end.
+ {ConsoleMsg, FileMsg} = get_log_messages(self(), info, Format, Args),
+ gen_event:sync_notify(error_logger, {couch_info, ConsoleMsg, FileMsg}).
error(Format, Args) ->
{ConsoleMsg, FileMsg} = get_log_messages(self(), error, Format, Args),