#include <mongocxx/v1/logger.hpp>
A scope guard to temporarily replace the current unstructured log message handler.
On construction, captures the current global logging configuration and installs the requested handler. On destruction, restores the captured configuration. Nesting is supported: guards restore each prior handler in reverse order of construction.
Public Member Functions | |
| logger_guard (log_handler handler) | |
| Register a custom unstructured log message handler for the lifetime of this guard. | |
| logger_guard (logger_guard &&)=delete | |
| This class is not moveable. | |
| logger_guard (logger_guard const &)=delete | |
| This class is not copyable. | |
| logger_guard (v1::default_logger tag) | |
| Register mongoc's default unstructured log message handler for the lifetime of this guard. | |
| ~logger_guard () | |
| Restore the unstructured log message handler that was active when this guard was constructed. | |
| logger_guard & | operator= (logger_guard &&)=delete |
| This class is not moveable. | |
| logger_guard & | operator= (logger_guard const &)=delete |
| This class is not copyable. | |
Restore the unstructured log message handler that was active when this guard was constructed.
|
delete |
This class is not moveable.
|
delete |
This class is not copyable.
|
explicit |
Register a custom unstructured log message handler for the lifetime of this guard.
| handler | The handler to register. Disable unstructured logging when null (empty). |
|
explicit |
Register mongoc's default unstructured log message handler for the lifetime of this guard.
| tag | Unused: only for overload resolution. |
|
delete |
This class is not moveable.
|
delete |
This class is not copyable.