RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
RDLog::CaptureLog Class Reference

#include <RDLog.h>

Inheritance diagram for RDLog::CaptureLog:
RDLog::CaptureErrorLog

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:

functionThatMayFail();
std::string errs = capture.messages();
RDKIT_RDGENERAL_EXPORT RDLogger rdErrorLog
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

◆ ~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: