Class for logging to CSV.
More...
#include <CsvLogger.h>
Inherits clockwerk::SimLogger.
|
| | CsvLogger (warpos::FlightExecutive &exec, const std::string &filename="output.csv", unsigned int buffer_size=1000) |
| | Constructor for CSV logger – wraps around logger constructor.
|
| | ~CsvLogger () |
| int | delimeter (const std::string &delim) |
| | Function to set the delimeter.
|
| int | filename (std::string name) |
| | Function to set CSV logger filename.
|
| int | close () |
| | Function to close down the file – logs remaining buffered data and closes.
|
| int | setPrecision (int precision) |
| | Function to set the precision of CSV logging.
|
| log_level_e | logLevel () |
| | Get the log level set for the executive.
|
| void | logLevel (log_level_e log_level) |
| | Set the executive log level.
|
Class for logging to CSV.
The CSV logger is a class that inherits from the base logger class and manually configures it to write to CSV.
◆ CsvLogger()
| warptwin::CsvLogger::CsvLogger |
( |
warpos::FlightExecutive & | exec, |
|
|
const std::string & | filename = "output.csv", |
|
|
unsigned int | buffer_size = 1000 ) |
Constructor for CSV logger – wraps around logger constructor.
◆ ~CsvLogger()
| warptwin::CsvLogger::~CsvLogger |
( |
| ) |
|
|
inline |
◆ _createSetupFile()
| int warptwin::CsvLogger::_createSetupFile |
( |
| ) |
|
|
protected |
Function to create a CSV file for logging.
◆ _writeToFile()
| int warptwin::CsvLogger::_writeToFile |
( |
| ) |
|
|
protected |
Function to write buffered data to CSV file.
◆ close()
| int warptwin::CsvLogger::close |
( |
| ) |
|
Function to close down the file – logs remaining buffered data and closes.
◆ delimeter()
| int warptwin::CsvLogger::delimeter |
( |
const std::string & | delim | ) |
|
Function to set the delimeter.
- Parameters
-
| delim | The delimeter to separate file values |
◆ filename()
| int warptwin::CsvLogger::filename |
( |
std::string | name | ) |
|
Function to set CSV logger filename.
- Parameters
-
| The | filename to set. If no extension applies, auto-set to .csv |
- Returns
- Error code corresponding to success/failure
◆ logLevel() [1/2]
Get the log level set for the executive.
- Returns
- Log level for the executive
◆ logLevel() [2/2]
| void warptwin::CsvLogger::logLevel |
( |
log_level_e | log_level | ) |
|
|
inline |
Set the executive log level.
- Parameters
-
| log_level | The level to set logging to |
◆ setPrecision()
| int warptwin::CsvLogger::setPrecision |
( |
int | precision | ) |
|
Function to set the precision of CSV logging.
- Parameters
-
| precision | The precision to set logging to as # of decimal places |
- Returns
- Error code corresponding to success/failure
◆ _delimeter
| std::string warptwin::CsvLogger::_delimeter |
|
protected |
String to indicate delimeter – set to comma by default.
◆ _fout
| std::ofstream warptwin::CsvLogger::_fout |
|
protected |
Stream variable to write file to.
◆ _local_log_level
The log level for this particular app.
◆ _precision
| int warptwin::CsvLogger::_precision = 20 |
|
protected |
The precision of logging. Default is 20 places.
◆ exc
Handle to executive for logging.
The documentation for this class was generated from the following files:
- /Users/mickey/Documents/Projects/warptwin/cpp/src/logging/CsvLogger.h
- /Users/mickey/Documents/Projects/warptwin/cpp/src/logging/CsvLogger.cpp