summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_db.hrl
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2010-06-13 14:15:29 +0000
committerAdam Kocoloski <kocolosk@apache.org>2010-06-13 14:15:29 +0000
commit3c83fe3827bcebf1e8bc8c5c16af1ad9fd9e0555 (patch)
tree469c71ebab8ec516ca19ae42f47cae586b0480e3 /src/couchdb/couch_db.hrl
parentd8c25ff8ee02aa5bb6f3a8aecf479109226d42db (diff)
synchronous logging, COUCHDB-761. Patch by Randall Leeds.
This patch fixes a bug where calls to get the log level could time out, resulting in an unexpected {ref(), integer()} message in the client's mailbox. This would crash some gen_servers that did not expect the message. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@954229 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_db.hrl')
-rw-r--r--src/couchdb/couch_db.hrl11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/couchdb/couch_db.hrl b/src/couchdb/couch_db.hrl
index f82406e8..f1b88a05 100644
--- a/src/couchdb/couch_db.hrl
+++ b/src/couchdb/couch_db.hrl
@@ -28,18 +28,23 @@
-define(LOG_DEBUG(Format, Args),
case couch_log:debug_on() of
- true -> error_logger:info_report(couch_debug, {Format, Args});
+ true ->
+ gen_event:sync_notify(error_logger,
+ {self(), couch_debug, {Format, Args}});
false -> ok
end).
-define(LOG_INFO(Format, Args),
case couch_log:info_on() of
- true -> error_logger:info_report(couch_info, {Format, Args});
+ true ->
+ gen_event:sync_notify(error_logger,
+ {self(), couch_info, {Format, Args}});
false -> ok
end).
-define(LOG_ERROR(Format, Args),
- error_logger:error_report(couch_error, {Format, Args})).
+ gen_event:sync_notify(error_logger,
+ {self(), couch_error, {Format, Args}})).
-record(rev_info,