1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>Db::set_msgfile()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="db.html" title="Chapter 2. The Db Handle" /> 11 <link rel="prev" href="dbset_msgcall.html" title="Db::set_msgcall()" /> 12 <link rel="next" href="dbset_pagesize.html" title="Db::set_pagesize()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Db::set_msgfile()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbset_msgcall.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 2. 23 The Db Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="dbset_pagesize.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="dbset_msgfile"></a>Db::set_msgfile()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40void Db::set_msgfile(FILE *msgfile); </pre> 41 <p> 42 There are interfaces in the Berkeley DB library which either directly 43 output informational messages or statistical information, or configure 44 the library to output such messages when performing other operations, 45 for example, 46 <a class="xref" href="envset_verbose.html" title="DbEnv::set_verbose()">DbEnv::set_verbose()</a> and 47 <a class="xref" href="envstat.html" title="DbEnv::stat_print()">DbEnv::stat_print()</a>. 48 </p> 49 <p> 50 The <a class="xref" href="envset_msgfile.html" title="DbEnv::set_msgfile()">DbEnv::set_msgfile()</a> and 51 <code class="methodname">Db::set_msgfile()</code> methods are used to display these messages for the 52 application. In this case the message will include a trailing 53 <newline> character. 54 </p> 55 <p> 56 Setting <span class="bold"><strong>msgfile</strong></span> to NULL unconfigures 57 the interface. 58 </p> 59 <p> 60 Alternatively, you can use the 61 <span> 62 <a class="xref" href="envset_message_stream.html" title="DbEnv::set_message_stream()">DbEnv::set_message_stream()</a> 63 and 64 <a class="xref" href="dbset_message_stream.html" title="Db::set_message_stream()">Db::set_message_stream()</a> 65 methods to display the messages via an output stream, or the 66 </span> 67 68 <a class="xref" href="envset_msgcall.html" title="DbEnv::set_msgcall()">DbEnv::set_msgcall()</a> or 69 <a class="xref" href="dbset_msgcall.html" title="Db::set_msgcall()">Db::set_msgcall()</a> 70 methods to capture the additional error information in a way that does 71 not use C library FILE *'s. 72 <span>You should not mix these approaches.</span> 73 </p> 74 <p> 75 For <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> handles opened 76 inside of Berkeley DB environments, calling the <code class="methodname">Db::set_msgfile()</code> 77 method affects the entire environment and is equivalent to calling the 78 <a class="xref" href="envset_msgfile.html" title="DbEnv::set_msgfile()">DbEnv::set_msgfile()</a> 79 method. 80 </p> 81 <p> 82 The <code class="methodname">Db::set_msgfile()</code> method configures operations performed using 83 the specified <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> handle, 84 not all operations performed on the underlying database. 85 </p> 86 <p> 87 The <code class="methodname">Db::set_msgfile()</code> method may be called at any time during the 88 life of the application. 89 </p> 90 <div class="sect2" lang="en" xml:lang="en"> 91 <div class="titlepage"> 92 <div> 93 <div> 94 <h3 class="title"><a id="id1649615"></a>Parameters</h3> 95 </div> 96 </div> 97 </div> 98 <div class="sect3" lang="en" xml:lang="en"> 99 <div class="titlepage"> 100 <div> 101 <div> 102 <h4 class="title"><a id="id1649647"></a>msgfile</h4> 103 </div> 104 </div> 105 </div> 106 <p> 107 The <span class="bold"><strong>msgfile</strong></span> parameter is a C library 108 FILE * to be used for displaying messages. 109 </p> 110 </div> 111 </div> 112 <div class="sect2" lang="en" xml:lang="en"> 113 <div class="titlepage"> 114 <div> 115 <div> 116 <h3 class="title"><a id="id1649855"></a>Class</h3> 117 </div> 118 </div> 119 </div> 120 <p> 121 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 122 </p> 123 </div> 124 <div class="sect2" lang="en" xml:lang="en"> 125 <div class="titlepage"> 126 <div> 127 <div> 128 <h3 class="title"><a id="id1648613"></a>See Also</h3> 129 </div> 130 </div> 131 </div> 132 <p> 133 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 134 </p> 135 </div> 136 </div> 137 <div class="navfooter"> 138 <hr /> 139 <table width="100%" summary="Navigation footer"> 140 <tr> 141 <td width="40%" align="left"><a accesskey="p" href="dbset_msgcall.html">Prev</a> </td> 142 <td width="20%" align="center"> 143 <a accesskey="u" href="db.html">Up</a> 144 </td> 145 <td width="40%" align="right"> <a accesskey="n" href="dbset_pagesize.html">Next</a></td> 146 </tr> 147 <tr> 148 <td width="40%" align="left" valign="top">Db::set_msgcall() </td> 149 <td width="20%" align="center"> 150 <a accesskey="h" href="index.html">Home</a> 151 </td> 152 <td width="40%" align="right" valign="top"> Db::set_pagesize()</td> 153 </tr> 154 </table> 155 </div> 156 </body> 157</html> 158