Loading...
Searching...
No Matches
mongocxx::logger Class Referenceabstract

`#include <mongocxx/v1/logger.hpp>`

## Description

The interface for an unstructured log message handler.

Important
  This interface does NOT fully conform to the CMAP specification!

## Public Member Functions

| logger ()=default
| Default constructor.
| logger (logger &&)=default
| Move constructor.
| logger (logger const &)=default
| Copy constructor.
virtual | ~logger ()
| Destructor.
virtual void | operator() (log_level level, bsoncxx::v1::stdx::string_view domain, bsoncxx::v1::stdx::string_view message) noexcept=0
| Handle an unstructured log message emitted by mongoc.
logger & | operator= (logger &&)=default
| Move assignment operator.
logger & | operator= (logger const &)=default
| Copy assignment operator.

## Constructor & Destructor Documentation

## ~logger()

virtual mongocxx::v1::logger::~logger | ( |  | ) |

virtual

Destructor.

## logger() [1/3]

mongocxx::v1::logger::logger | ( | logger && |  | ) |

default

Move constructor.

## logger() [2/3]

mongocxx::v1::logger::logger | ( | logger const & |  | ) |

default

Copy constructor.

## logger() [3/3]

mongocxx::v1::logger::logger | ( |  | ) |

default

Default constructor.

## Member Function Documentation

## operator()()

virtual void mongocxx::v1::logger::operator() | ( | log_level | level,
|  | bsoncxx::v1::stdx::string_view | domain,
|  | bsoncxx::v1::stdx::string_view | message )

pure virtual noexcept

Handle an unstructured log message emitted by mongoc.

Users may override this function to implement custom log message behavior such as outputting messages to a file or sending messages to a remote server.

Parameters

  level | The log level for the message being handled.
  domain | The domain of the message.
  message | The contents of the log message.

See also
  - Custom Log handlers (mongoc)

## operator=() [1/2]

logger & mongocxx::v1::logger::operator= | ( | logger && |  | ) |

default

Move assignment operator.

## operator=() [2/2]

logger & mongocxx::v1::logger::operator= | ( | logger const & |  | ) |

default

Copy assignment operator.

The documentation for this class was generated from the following file:

- mongocxx/v1/logger.hpp