From 3c83fe3827bcebf1e8bc8c5c16af1ad9fd9e0555 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Sun, 13 Jun 2010 14:15:29 +0000 Subject: 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 --- src/couchdb/couch_db.hrl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/couchdb/couch_db.hrl') 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, -- cgit v1.2.3