Library Version 18.1.25

DbEnv::msg()
Prev | Chapter 5. The DbEnv Handle | Next

## DbEnv::msg()

    #include <db_cxx.h>

    DbEnv::msg(const char *fmt, ...);

The `DbEnv::msg()` and Db::msg() methods provide informational messaging functionality for applications written using the Berkeley DB library.

The Db::msg() and DbEnv::msg() methods constructs an informational message consisting of the following elements:

- An optional prefix string

  If no informational callback function has been set using the DbEnv::set_msgcall() method, any prefix string specified using the DbEnv::set_msgpfx() method.

- An optional printf-style message

  The supplied message fmt, if non-NULL, in which the ANSI C X3.159-1989 (ANSI C) printf function specifies how subsequent parameters are converted for output.

This constructed informational message is then handled as follows:

- If an informational callback function has been set (see Db::set_msgcall() and DbEnv::set_msgcall() ), that function is called with two parameters: any prefix string specified (see Db::set_msgpfx() and DbEnv::set_msgpfx() ) and the informational message.

- If a C library FILE * has been set (see Db::set_msgfile() and DbEnv::set_msgfile() ), the informational message is written to that output stream.

- If a C++ ostream has been set (see DbEnv::set_message_stream() and Db::set_message_stream()), the informational message is written to that stream.

- If none of these output options have been configured, the message is written to stdout, the standard output stream.

### Note

The total length of the message written by this method, including the prefix string, can be no longer than 4096.

### Parameters

#### fmt

The fmt parameter is an optional printf-style message to display.

### Class

DbEnv

### See Also

Database Environments and Related Methods

Prev | Up | Next
DbEnv::lsn_reset() | Home | DbEnv::open()