diff options
author | Damien F. Katz <damien@apache.org> | 2008-04-20 18:17:15 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2008-04-20 18:17:15 +0000 |
commit | fb5b6bbc5aa941478d700e8fb3011c2a24c4d2d4 (patch) | |
tree | bcc23ed4869f395e894f76ec3fb5e76f75a5ba98 /src/couchdb/couch_file.erl | |
parent | ad230e67fb09883e2171291d5a42635f5e2addb9 (diff) |
Added proper UUID generation and changed the details of how way debug logging is done to now use a more effcient macro instead of a function call.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@649948 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_file.erl')
-rw-r--r-- | src/couchdb/couch_file.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl index 3a1a7af1..d42d0eb6 100644 --- a/src/couchdb/couch_file.erl +++ b/src/couchdb/couch_file.erl @@ -13,6 +13,8 @@ -module(couch_file). -behaviour(gen_server). +-include("couch_db.hrl"). + -define(HEADER_SIZE, 2048). % size of each segment of the doubly written header -export([open/1, open/2, close/1, pread/3, pwrite/3, expand/2, bytes/1, sync/1]). @@ -178,12 +180,12 @@ read_header(Fd, Prefix) -> false -> % To get here we must have two different header versions with signatures intact. % It's weird but possible (a commit failure right at the 2k boundary). Log it and take the first. - couch_log:info("Header version differences.~nPrimary Header: ~p~nSecondary Header: ~p", [Header1, Header2]), + ?LOG_INFO("Header version differences.~nPrimary Header: ~p~nSecondary Header: ~p", [Header1, Header2]), {ok, Header1} end; {error, Error} -> % error reading second header. It's ok, but log it. - couch_log:info("Secondary header corruption (error: ~p). Using primary header.", [Error]), + ?LOG_INFO("Secondary header corruption (error: ~p). Using primary header.", [Error]), {ok, Header1} end; {error, Error} -> @@ -191,7 +193,7 @@ read_header(Fd, Prefix) -> case extract_header(Prefix, Bin2) of {ok, Header2} -> % log corrupt primary header. It's ok since the secondary is still good. - couch_log:info("Primary header corruption (error: ~p). Using secondary header.", [Error]), + ?LOG_INFO("Primary header corruption (error: ~p). Using secondary header.", [Error]), {ok, Header2}; _ -> % error reading secondary header too |