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_message_stream()</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_lorder.html" title="Db::set_lorder()" /> 12 <link rel="next" href="dbset_msgcall.html" title="Db::set_msgcall()" /> 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_message_stream()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="dbset_lorder.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_msgcall.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_message_stream"></a>Db::set_message_stream()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40void Db::set_message_stream(class ostream*); </pre> 41 <p> 42 There are interfaces in the Berkeley DB library which either 43 directly output informational messages or statistical 44 information, or configure the library to output such messages 45 when performing other operations. For example, the 46 <a class="xref" href="envset_verbose.html" title="DbEnv::set_verbose()">DbEnv::set_verbose()</a> 47 and <a class="xref" href="envstat.html" title="DbEnv::stat_print()">DbEnv::stat_print()</a> 48 methods. 49 </p> 50 <p> 51 The <a class="xref" href="envset_message_stream.html" title="DbEnv::set_message_stream()">DbEnv::set_message_stream()</a> 52 and <code class="methodname">Db::set_message_stream()</code> methods are used 53 to display these messages for the application. In this case, the message will include a 54 trailing <code class="literal"><newline></code> character. 55 </p> 56 <p> 57 Setting <span class="bold"><strong>stream</strong></span> to NULL unconfigures the interface. 58 </p> 59 <p> 60 Alternatively, you can use the 61 <a class="xref" href="envset_msgfile.html" title="DbEnv::set_msgfile()">DbEnv::set_msgfile()</a> or 62 <a class="xref" href="dbset_msgfile.html" title="Db::set_msgfile()">Db::set_msgfile()</a> methods 63 to display the additional information via a C Library <code class="literal">FILE *</code>, 64 or the <a class="xref" href="envset_msgcall.html" title="DbEnv::set_msgcall()">DbEnv::set_msgcall()</a> 65 and <a class="xref" href="dbset_msgcall.html" title="Db::set_msgcall()">Db::set_msgcall()</a> 66 methods to capture the additional error information in a way that does not use either 67 output streams or C Library <code class="literal">FILE *</code>'s. 68 You should not mix these approaches. 69 </p> 70 <p> 71 For <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> handles opened inside of Berkeley DB 72 environments, calling the <code class="methodname">Db::set_message_stream()</code> method 73 affects the entire environment and is equivalent to calling the 74 <a class="xref" href="envset_message_stream.html" title="DbEnv::set_message_stream()">DbEnv::set_message_stream()</a> method. 75 </p> 76 <p> 77 The <code class="methodname">Db::set_message_stream()</code> method configures 78 operations performed using the specified 79 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 80 handle, not all operations performed on the underlying database. 81 </p> 82 <p> 83 The <code class="methodname">Db::set_message_stream()</code> method may be called at any time during the 84 life of the application. 85 </p> 86 <div class="sect2" lang="en" xml:lang="en"> 87 <div class="titlepage"> 88 <div> 89 <div> 90 <h3 class="title"><a id="id1649242"></a>Parameters</h3> 91 </div> 92 </div> 93 </div> 94 <div class="sect3" lang="en" xml:lang="en"> 95 <div class="titlepage"> 96 <div> 97 <div> 98 <h4 class="title"><a id="id1649237"></a>stream</h4> 99 </div> 100 </div> 101 </div> 102 <p> 103 The <span class="bold"><strong>stream</strong></span> parameter is the 104 application-specified output stream to be used for additional message 105 information. 106 </p> 107 </div> 108 </div> 109 <div class="sect2" lang="en" xml:lang="en"> 110 <div class="titlepage"> 111 <div> 112 <div> 113 <h3 class="title"><a id="id1649384"></a>Class</h3> 114 </div> 115 </div> 116 </div> 117 <p> 118 <a class="link" href="db.html" title="Chapter 2. The Db Handle">Db</a> 119 </p> 120 </div> 121 <div class="sect2" lang="en" xml:lang="en"> 122 <div class="titlepage"> 123 <div> 124 <div> 125 <h3 class="title"><a id="id1648946"></a>See Also</h3> 126 </div> 127 </div> 128 </div> 129 <p> 130 <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> 131 </p> 132 </div> 133 </div> 134 <div class="navfooter"> 135 <hr /> 136 <table width="100%" summary="Navigation footer"> 137 <tr> 138 <td width="40%" align="left"><a accesskey="p" href="dbset_lorder.html">Prev</a> </td> 139 <td width="20%" align="center"> 140 <a accesskey="u" href="db.html">Up</a> 141 </td> 142 <td width="40%" align="right"> <a accesskey="n" href="dbset_msgcall.html">Next</a></td> 143 </tr> 144 <tr> 145 <td width="40%" align="left" valign="top">Db::set_lorder() </td> 146 <td width="20%" align="center"> 147 <a accesskey="h" href="index.html">Home</a> 148 </td> 149 <td width="40%" align="right" valign="top"> Db::set_msgcall()</td> 150 </tr> 151 </table> 152 </div> 153 </body> 154</html> 155