Subject: | set_msgfile API |
Date: | Sat, 23 May 2009 12:33:09 +0400 |
To: | bug-BerkeleyDB [...] rt.cpan.org |
From: | Alexey Tourbin <at [...] altlinux.ru> |
Hello again,
Actually I'm trying to implement memoization cache with BerkeleyDB,
using CDS to provide smooth multiple-reader+single-writer access,
with automatic recovery for stale read locks.
http://git.altlinux.org/people/at/packages/perl-qa-cache.git
(I am going to release the code under GPL.)
When failchk removes stale read locks, it prints a messages, for which
it uses stdout by default.
lock/lock_failchk.c: __db_msg(env, "Freeing read locks for locker %#lx: %s",
Now, this is a problem: stdout is reserved for normal output, in a way
to be usable by other programs. "Freeing read locks" message then
simply spoils stdout. Currently there seems to be no easy way to
suppress or redirect such messages.
However, the library provides set_msgfile method:
http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_set_msgfile.html
I believe it would be nice to add corresponding -MsgFile parameter,
akin to -ErrFile, to BerkeleyDB.
Message body not shown because it is not plain text.