JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
LogException Class Reference

Detailed Description

Definition at line 218 of file FGLog.h.

+ Inheritance diagram for LogException:
+ Collaboration diagram for LogException:

Public Member Functions

 LogException (LogException &other)
 
const char * what () const noexcept override
 
- Public Member Functions inherited from FGLogging
 FGLogging (LogLevel level)
 
void Flush (void)
 
FGLoggingoperator<< (const char *message)
 
FGLoggingoperator<< (const FGColumnVector3 &vec)
 
FGLoggingoperator<< (const SGPath &path)
 
FGLoggingoperator<< (const std::string &message)
 
FGLoggingoperator<< (int value)
 
FGLoggingoperator<< (LogFormat format)
 
FGLoggingoperator<< (setprecision_t value)
 
FGLoggingoperator<< (setw_t value)
 
FGLoggingoperator<< (std::ios_base &(*manipulator)(std::ios_base &))
 
FGLoggingoperator<< (std::ostream &(*manipulator)(std::ostream &))
 
template<typename T , typename = std::enable_if_t<std::is_arithmetic<T>::value>>
FGLoggingoperator<< (T value)
 
std::streambuf * rdbuf ()
 

Additional Inherited Members

- Protected Member Functions inherited from FGLogging
 FGLogging (FGLogger_ptr l)
 
- Protected Attributes inherited from FGLogging
std::ostringstream buffer
 
FGLogger_ptr logger
 

Constructor & Destructor Documentation

◆ LogException() [1/2]

Definition at line 237 of file FGLog.cpp.

238: BaseException(""), FGLogging(std::make_shared<BufferLogger>())
239{
240 logger->SetLevel(LogLevel::FATAL);
241}

◆ LogException() [2/2]

LogException ( LogException other)

Definition at line 245 of file FGLog.cpp.

246: BaseException(""), FGLogging(other.logger)
247{
248 other.Flush(); // Make the data buffered in `other` accessible to all copies.
249}

Member Function Documentation

◆ what()

const char * what ( ) const
overridenoexcept

Definition at line 253 of file FGLog.cpp.

254{
255 // Although using const_cast is generally discouraged, it is justified here because:
256 // 1. The what() method must be const to comply with std::exception interface
257 // 2. We need to ensure all buffered messages are flushed before returning the error message
258 // 3. Conceptually, getting the complete error message is a "logically const" operation
259 // i.e. from the user's perspective, it doesn't modify the state of the object.
260 const_cast<LogException*>(this)->Flush();
261 return static_cast<BufferLogger*>(logger.get())->c_str();
262}

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