1<!--$Id: db_set_msgfile.so,v 1.1 2004/07/14 19:30:39 bostic Exp $-->
2<!--$Id: env_set_msgfile.so,v 10.7 2006/02/10 22:54:59 bostic Exp $-->
3<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
4<!--See the file LICENSE for redistribution information.-->
5<html>
6<head>
7<title>Berkeley DB: Db::set_msgfile</title>
8<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
10</head>
11<body bgcolor=white>
12<table width="100%"><tr valign=top>
13<td>
14<b>Db::set_msgfile</b>
15</td>
16<td align=right>
17<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a>
18<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
19</tr></table>
20<hr size=1 noshade>
21<tt>
22<b><pre>
23#include &lt;db_cxx.h&gt;
24<p>
25void Db::set_msgfile(FILE *msgfile);
26<p>
27void Db::get_msgfile(FILE **msgfilep);
28</pre></b>
29<hr size=1 noshade>
30<b>Description: Db::set_msgfile</b>
31<p>There are interfaces in the Berkeley DB library which either directly output
32informational messages or statistical information, or configure the
33library to output such messages when performing other operations, for
34example, <a href="../api_cxx/env_set_verbose.html">DbEnv::set_verbose</a> and <a href="../api_cxx/env_stat.html">DbEnv::stat_print</a>.</p>
35<p>The <a href="../api_cxx/env_set_msgfile.html">DbEnv::set_msgfile</a> and Db::set_msgfile methods are used to
36display these messages for the application.  In this case, the message
37will include a trailing &lt;newline&gt; character.</p>
38<p>Setting <b>msgfile</b> to NULL unconfigures the interface.</p>
39<p>Alternatively, you can use the <a href="../api_cxx/env_set_msg_stream.html">DbEnv::set_message_stream</a> and
40<a href="../api_cxx/db_set_msg_stream.html">Db::set_message_stream</a> methods to display the messages via an output
41stream, or the <a href="../api_cxx/env_set_msgcall.html">DbEnv::set_msgcall</a> and <a href="../api_cxx/db_set_msgcall.html">Db::set_msgcall</a> methods
42to capture the additional error information in a way that does not use
43either output streams or C library FILE *'s.  You should not mix these
44approaches.</p>
45<p>For <a href="../api_cxx/db_class.html">Db</a> handles opened inside of Berkeley DB environments, calling the
46Db::set_msgfile method affects the entire environment and is equivalent to calling
47the <a href="../api_cxx/env_set_msgfile.html">DbEnv::set_msgfile</a> method.</p>
48<p>The Db::set_msgfile method configures operations performed using the specified
49<a href="../api_cxx/db_class.html">Db</a> handle, not all operations performed on the underlying
50database.</p>
51<p>The Db::set_msgfile method may be called at any time during the life of the
52application.</p>
53<b>Parameters</b> <br>
54 <b>msgfile</b><ul compact><li>The <b>msgfile</b> parameter is a C library FILE * to be used for
55displaying messages.</ul>
56<br>
57<hr size=1 noshade>
58<b>Description: Db::get_msgfile</b>
59<p>The Db::get_msgfile method returns the FILE *.</p>
60<p>The Db::get_msgfile method may be called at any time during the life of the
61application.</p>
62<p>The Db::get_msgfile method
63either returns a non-zero error value
64or throws an exception that encapsulates a non-zero error value on
65failure, and returns 0 on success.
66</p>
67<b>Parameters</b> <br>
68 <b>msgfilep</b><ul compact><li>The Db::get_msgfile method returns  the
69FILE * in <b>msgfilep</b>.</ul>
70<br>
71<hr size=1 noshade>
72<br><b>Class</b>
73<a href="../api_cxx/db_class.html">Db</a>
74<br><b>See Also</b>
75<a href="../api_cxx/db_list.html">Databases and Related Methods</a>
76</tt>
77<table width="100%"><tr><td><br></td><td align=right>
78<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
79</td></tr></table>
80<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
81</body>
82</html>
83