MySQL  8.0.21
Source Code Documentation
ib::fatal_or_error Class Reference

Emit a fatal message if the given predicate is true, otherwise emit a error message. More...

#include <ut0ut.h>

Inheritance diagram for ib::fatal_or_error:
ib::logger

Public Member Functions

 fatal_or_error (bool fatal)
 Default constructor uses ER_IB_MSG_0. More...
 
template<class... Args>
 fatal_or_error (bool fatal, int err, Args &&... args)
 Constructor. More...
 
virtual ~fatal_or_error ()
 Destructor. More...
 
- Public Member Functions inherited from ib::logger
virtual ~logger ()
 Destructor. More...
 
template<class... Args>
loggerlog (int err, Args &&... args)
 Format an error message. More...
 
template<typename T >
loggeroperator<< (const T &rhs)
 
std::ostream & write (const char *buf, std::streamsize count)
 Write the given buffer to the internal string stream object. More...
 
std::ostream & write (const byte *buf, std::streamsize count)
 Write the given buffer to the internal string stream object. More...
 

Private Attributes

const bool m_fatal
 If true then assert after printing an error message. More...
 

Additional Inherited Members

- Public Attributes inherited from ib::logger
std::ostringstream m_oss
 For converting the message into a string. More...
 
int m_err {}
 Error code in errmsg-*.txt. More...
 
loglevel m_level {INFORMATION_LEVEL}
 Error logging level. More...
 
- Protected Member Functions inherited from ib::logger
void log_event (std::string msg)
 Uses LogEvent to report the log entry, using provided message. More...
 
 logger (loglevel level, int err)
 Constructor. More...
 
template<class... Args>
 logger (loglevel level, int err, Args &&... args)
 Constructor. More...
 
 logger (loglevel level)
 Constructor. More...
 
- Static Protected Member Functions inherited from ib::logger
template<class... Args>
static std::string msg (int err, Args &&... args)
 Format an error message. More...
 

Detailed Description

Emit a fatal message if the given predicate is true, otherwise emit a error message.

Constructor & Destructor Documentation

◆ fatal_or_error() [1/2]

ib::fatal_or_error::fatal_or_error ( bool  fatal)
inline

Default constructor uses ER_IB_MSG_0.

Parameters
[in]fataltrue if it's a fatal message

◆ fatal_or_error() [2/2]

template<class... Args>
ib::fatal_or_error::fatal_or_error ( bool  fatal,
int  err,
Args &&...  args 
)
inlineexplicit

Constructor.

Parameters
[in]fataltrue if it's a fatal message
[in]errError code from errmsg-*.txt.
[in]argsVariable length argument list

◆ ~fatal_or_error()

ib::fatal_or_error::~fatal_or_error ( )
virtual

Destructor.

Member Data Documentation

◆ m_fatal

const bool ib::fatal_or_error::m_fatal
private

If true then assert after printing an error message.


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