Library Version 12.1.6.2

Db::msg()
Prev | Chapter 2. The Db Handle | Next

## Db::msg()

    #include <db_cxx.h>

    Db::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 construct 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 informational 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

Db

### See Also

Database and Related Methods

Prev | Up | Next
Db::key_range() | Home | Db::open()