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
FGLogging Class Reference

Detailed Description

Definition at line 163 of file FGLog.h.

+ Inheritance diagram for FGLogging:
+ Collaboration diagram for FGLogging:

Public Member Functions

 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 ()
 

Protected Member Functions

 FGLogging (FGLogger_ptr l)
 

Protected Attributes

std::ostringstream buffer
 
FGLogger_ptr logger
 

Constructor & Destructor Documentation

◆ FGLogging() [1/2]

FGLogging ( LogLevel  level)

Definition at line 136 of file FGLog.cpp.

137 : logger(GlobalLogger)
138{
139 logger->SetLevel(level);
140}

◆ ~FGLogging()

virtual ~FGLogging ( )
inlinevirtual

Definition at line 168 of file FGLog.h.

168{ Flush(); }

◆ FGLogging() [2/2]

FGLogging ( FGLogger_ptr  l)
inlineprotected

Definition at line 190 of file FGLog.h.

190: logger(l) {}

Member Function Documentation

◆ Flush()

void Flush ( void  )

Definition at line 144 of file FGLog.cpp.

145{
146 std::string message = buffer.str();
147
148 if (!message.empty()) {
149 logger->Message(message);
150 buffer.str("");
151 }
152
153 logger->Flush();
154}

◆ operator<<() [1/11]

FGLogging & operator<< ( const char *  message)
inline

Definition at line 169 of file FGLog.h.

169{ buffer << message ; return *this; }

◆ operator<<() [2/11]

FGLogging & operator<< ( const FGColumnVector3 vec)
inline

Definition at line 185 of file FGLog.h.

185{ buffer << vec; return *this; }

◆ operator<<() [3/11]

FGLogging & operator<< ( const SGPath &  path)
inline

Definition at line 184 of file FGLog.h.

184{ buffer << path; return *this; }

◆ operator<<() [4/11]

FGLogging & operator<< ( const std::string &  message)
inline

Definition at line 170 of file FGLog.h.

170{ buffer << message ; return *this; }

◆ operator<<() [5/11]

FGLogging & operator<< ( int  value)
inline

Definition at line 172 of file FGLog.h.

172{ buffer << value; return *this; }

◆ operator<<() [6/11]

FGLogging & operator<< ( LogFormat  format)

Definition at line 158 of file FGLog.cpp.

159{
160 std::string message = buffer.str();
161
162 if (!message.empty()) {
163 logger->Message(message);
164 buffer.str("");
165 }
166
167 logger->Format(format);
168 return *this;
169}

◆ operator<<() [7/11]

FGLogging & operator<< ( setprecision_t  value)
inline

Definition at line 178 of file FGLog.h.

178{ buffer << value; return *this; }

◆ operator<<() [8/11]

FGLogging & operator<< ( setw_t  value)
inline

Definition at line 182 of file FGLog.h.

182{ buffer << value; return *this; }

◆ operator<<() [9/11]

FGLogging & operator<< ( std::ios_base &(*)(std::ios_base &)  manipulator)
inline

Definition at line 177 of file FGLog.h.

177{ buffer << manipulator; return *this; }

◆ operator<<() [10/11]

FGLogging & operator<< ( std::ostream &(*)(std::ostream &)  manipulator)
inline

Definition at line 176 of file FGLog.h.

176{ buffer << manipulator; return *this; }

◆ operator<<() [11/11]

template<typename T , typename = std::enable_if_t<std::is_arithmetic<T>::value>>
FGLogging & operator<< ( value)
inline

Definition at line 175 of file FGLog.h.

175{ buffer << value; return *this; }

◆ rdbuf()

std::streambuf * rdbuf ( )
inline

Definition at line 187 of file FGLog.h.

187{ return buffer.rdbuf(); }

Member Data Documentation

◆ buffer

std::ostringstream buffer
protected

Definition at line 193 of file FGLog.h.

◆ logger

FGLogger_ptr logger
protected

Definition at line 192 of file FGLog.h.


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