Loading...
Searching...
No Matches
RDLog::CaptureLog Class Reference

`#include <RDLog.h>`

Inheritance diagram for RDLog::CaptureLog:

## Public Member Functions

| CaptureLog (RDLogger log)
| ~CaptureLog ()
std::string | messages () const
| Returns all messages captured since construction.

## Detailed Description

RAII class to capture messages from a given `RDLogger`.

The log is enabled when this object is constructed and its original enabled state is restored when this object is destroyed. The stream destination is also restored on destruction. Nesting is supported: inner captures shadow outer ones.

Example:

RDLog::CaptureLog capture{rdErrorLog};
functionThatMayFail();
std::string errs = capture.messages();
rdErrorLog
RDKIT_RDGENERAL_EXPORT RDLogger rdErrorLog
RDLog::CaptureLog
Definition RDLog.h:165
RDLog::CaptureLog::messages
std::string messages() const
Returns all messages captured since construction.

Definition at line 165 of file RDLog.h.

## Constructor & Destructor Documentation

## CaptureLog()

RDLog::CaptureLog::CaptureLog | ( | RDLogger | log | ) |

explicit

Referenced by RDLog::CaptureErrorLog::CaptureErrorLog().

## ~CaptureLog()

RDLog::CaptureLog::~CaptureLog | ( |  | ) |

## Member Function Documentation

## messages()

std::string RDLog::CaptureLog::messages | ( |  | ) | const

Returns all messages captured since construction.

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

- RDLog.h