Definition at line 202 of file FGLog.h.
|
| void | FileLocation (const std::string &filename, int line) override |
| | Optionally provides source filename and line for contextual diagnostics.
|
| |
| void | Flush (void) override |
| | Ends the current log record and commits any buffered output.
|
| |
| void | Format (LogFormat format) override |
| | Applies a formatting hint to subsequent output.
|
| |
| void | Message (const std::string &message) override |
| | Appends message text. May be called multiple times per log record.
|
| |
| void | SetMinLevel (LogLevel level) |
| |
| virtual | ~FGLogger () |
| | Virtual destructor for polymorphic use.
|
| |
| virtual void | SetLevel (LogLevel level) |
| | Starts a new log record and provides its severity level.
|
| |
◆ ~FGLogConsole()
Definition at line 211 of file FGLog.h.
void Flush(void) override
Ends the current log record and commits any buffered output.
◆ FileLocation()
| void FileLocation |
( |
const std::string & |
filename, |
|
|
int |
line |
|
) |
| |
|
inlineoverridevirtual |
Optionally provides source filename and line for contextual diagnostics.
Reimplemented from FGLogger.
Definition at line 206 of file FGLog.h.
207 { buffer.append("\nIn file " + filename + ": line " + std::to_string(line) + "\n"); }
◆ Flush()
Ends the current log record and commits any buffered output.
Reimplemented from FGLogger.
Definition at line 181 of file FGLog.cpp.
181 {
182 if (log_level >= min_level || log_level == LogLevel::STDOUT) {
183 switch (log_level)
184 {
185 case LogLevel::BULK:
186 case LogLevel::DEBUG:
187 case LogLevel::INFO:
188 case LogLevel::STDOUT:
189 std::cout << buffer;
190 std::cout.flush();
191 break;
192 default:
193 std::cerr << buffer;
194 std::cerr.flush();
195 break;
196 }
197 }
198
199 buffer.clear();
200}
◆ Format()
| void Format |
( |
LogFormat |
format | ) |
|
|
overridevirtual |
Applies a formatting hint to subsequent output.
Reimplemented from FGLogger.
Definition at line 204 of file FGLog.cpp.
204 {
205 switch (format)
206 {
207 case LogFormat::RED:
209 break;
210 case LogFormat::BLUE:
212 break;
213 case LogFormat::BOLD:
215 break;
216 case LogFormat::NORMAL:
218 break;
219 case LogFormat::UNDERLINE_ON:
221 break;
222 case LogFormat::UNDERLINE_OFF:
224 break;
225 case LogFormat::DEFAULT:
227 break;
228 case LogFormat::RESET:
229 default:
231 break;
232 }
233}
static char normint[6]
normal intensity text
static char fgred[6]
red text
static char fgblue[6]
blue text
static char underon[5]
underlines text
static char fgdef[6]
default text
static char reset[5]
resets text properties
static char underoff[6]
underline off
static char highint[5]
highlights text
◆ Message()
| void Message |
( |
const std::string & |
message | ) |
|
|
inlineoverridevirtual |
Appends message text. May be called multiple times per log record.
Implements FGLogger.
Definition at line 208 of file FGLog.h.
208{ buffer.append(message); }
◆ SetMinLevel()
| void SetMinLevel |
( |
LogLevel |
level | ) |
|
|
inline |
Definition at line 205 of file FGLog.h.
205{ min_level = level; }
◆ buffer
◆ min_level
| LogLevel min_level = LogLevel::BULK |
|
protected |
The documentation for this class was generated from the following files: