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