1
<!--$Id: env_set_error_stream.so,v 10.15 2001/04/12 18:48:44 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DbEnv::set_error_stream</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DbEnv::set_error_stream</h1>
17
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
#include <db_cxx.h>
24
void DbEnv::set_error_stream(class ostream*);
27
<p>When an error occurs in the Berkeley DB library, an exception is thrown or an
28
<b>errno</b> value is returned by the method. In some cases,
29
however, the <b>errno</b> value may be insufficient to completely
30
describe the cause of the error, especially during initial application
32
<p>The DbEnv::set_error_stream method is used to enhance the mechanism for
33
reporting error messages to the application by setting the C++ ostream
34
used for displaying additional Berkeley DB error messages. In some cases,
35
when an error occurs, Berkeley DB will output an additional error message to
37
<p>The error message will consist of the prefix string and a colon
38
("<b>:</b>") (if a prefix string was previously specified using
39
<a href="../api_cxx/env_set_errpfx.html">DbEnv::set_errpfx</a>), an error string, and a trailing
40
<newline> character.
41
<p>Alternatively, you can use the <a href="../api_cxx/env_set_errfile.html">DbEnv::set_errfile</a> method to display
42
the additional information via a C library FILE *, or the
43
<a href="../api_cxx/env_set_errcall.html">DbEnv::set_errcall</a> method to capture the additional error information in
44
a way that does not use either output streams or C library FILE *'s. You
45
should not mix these approaches.
46
<p>This error-logging enhancement does not slow performance or significantly
47
increase application size, and may be run during normal operation as well
48
as during application debugging.
50
<a href="../api_cxx/dbenv_class.html">DbEnv</a>
52
<a href="../api_cxx/env_close.html">DbEnv::close</a>,
53
<a href="../api_cxx/env_err.html">DbEnv::err</a>, <a href="../api_cxx/env_err.html">DbEnv::errx</a>
54
<a href="../api_cxx/env_open.html">DbEnv::open</a>,
55
<a href="../api_cxx/env_remove.html">DbEnv::remove</a>,
56
<a href="../api_cxx/env_set_alloc.html">DbEnv::set_alloc</a>,
57
<a href="../api_cxx/env_set_cachesize.html">DbEnv::set_cachesize</a>,
58
<a href="../api_cxx/env_set_data_dir.html">DbEnv::set_data_dir</a>,
59
<a href="../api_cxx/env_set_errcall.html">DbEnv::set_errcall</a>,
60
<a href="../api_cxx/env_set_errfile.html">DbEnv::set_errfile</a>,
61
<a href="../api_cxx/env_set_error_stream.html">DbEnv::set_error_stream</a>,
62
<a href="../api_cxx/env_set_errpfx.html">DbEnv::set_errpfx</a>,
63
<a href="../api_cxx/env_set_feedback.html">DbEnv::set_feedback</a>,
64
<a href="../api_cxx/env_set_flags.html">DbEnv::set_flags</a>,
65
<a href="../api_cxx/env_set_mutexlocks.html">DbEnv::set_mutexlocks</a>,
66
<a href="../api_cxx/env_set_pageyield.html">DbEnv::set_pageyield</a>,
67
<a href="../api_cxx/env_set_paniccall.html">DbEnv::set_paniccall</a>,
68
<a href="../api_cxx/env_set_panicstate.html">DbEnv::set_panicstate</a>,
69
<a href="../api_cxx/env_set_rec_init.html">DbEnv::set_recovery_init</a>,
70
<a href="../api_cxx/env_set_rpc_server.html">DbEnv::set_rpc_server</a>,
71
<a href="../api_cxx/env_set_region_init.html">DbEnv::set_region_init</a>,
72
<a href="../api_cxx/env_set_shm_key.html">DbEnv::set_shm_key</a>,
73
<a href="../api_cxx/env_set_tas_spins.html">DbEnv::set_tas_spins</a>,
74
<a href="../api_cxx/env_set_tmp_dir.html">DbEnv::set_tmp_dir</a>,
75
<a href="../api_cxx/env_set_verbose.html">DbEnv::set_verbose</a>,
76
<a href="../api_cxx/env_strerror.html">DbEnv::strerror</a>
78
<a href="../api_cxx/env_version.html">DbEnv::version</a>.
80
<table width="100%"><tr><td><br></td><td align=right>
81
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
83
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>