Rigid Body Dynamics Library
LoggingGuard Class Reference

Helper object to ignore any logs that happen during its lifetime. More...

#include <Logging.h>

Public Member Functions

 LoggingGuard ()
 
 ~LoggingGuard ()
 

Private Attributes

std::ostringstream log_backup
 

Detailed Description

Helper object to ignore any logs that happen during its lifetime.

If an instance of this class exists all logging gets suppressed. This allows to disable logging for a certain scope or a single function call, e.g.

{
// logging will be active
do_some_stuff();
// now create a new scope in which a LoggingGuard instance exists
{
LoggingGuard ignore_logging;
// as a _Nologging instance exists, all logging will be discarded
do_some_crazy_stuff();
}
// logging will be active again
do_some_more_stuff();
}
Helper object to ignore any logs that happen during its lifetime.
Definition: Logging.h:58

Definition at line 58 of file Logging.h.

Constructor & Destructor Documentation

◆ LoggingGuard()

LoggingGuard ( )
inline

Definition at line 60 of file Logging.h.

References LogOutput.

◆ ~LoggingGuard()

~LoggingGuard ( )
inline

Definition at line 64 of file Logging.h.

References LogOutput.

Field Documentation

◆ log_backup

std::ostringstream log_backup
private

Definition at line 70 of file Logging.h.


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