|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
Append-only CSV logger with automatic file rotation after a line-count limit. More...
#include <CsvLog.hpp>
Public Member Functions | |
| template<class T_titles > | |
| CsvLog (T_titles &&n_titles, std::unique_ptr< std::ostream > n_pOs) | |
| Construct a logger with externally-provided titles and output stream. | |
| template<class T_titles > | |
| CsvLog (T_titles &&n_titles, const std::string &n_log_name_bare, const std::string &n_log_name_suffix=".csv", int64_t n_n_line_max=10000) | |
| Construct a logger that creates / manages its own output files. | |
| template<class TMap > | |
| void | WriteLine (TMap &&title_to_value, int nPrecision) |
Append one CSV row by looking up each column in title_to_value. | |
| void | WriteTitle () |
| Emit the title row (called automatically on the first WriteLine). | |
Append-only CSV logger with automatic file rotation after a line-count limit.
One instance writes rows to a file, using a caller-provided ordered list of column titles. After n_line_max rows the output is rotated to <bare>_<block>.suffix to keep any single file size bounded.
Typical use: one CsvLog per solver per rank-0 process, recording per-iteration diagnostics with LogSimpleDIValue entries keyed by title.
Definition at line 65 of file CsvLog.hpp.
|
inline |
Construct a logger with externally-provided titles and output stream.
Definition at line 87 of file CsvLog.hpp.
|
inline |
Construct a logger that creates / manages its own output files.
| n_titles | Column titles (ordered). |
| n_log_name_bare | Base path without suffix, e.g. "out/run". |
| n_log_name_suffix | Filename suffix including dot (default ".csv"). |
| n_n_line_max | Rotate to a new file every this many lines. |
Definition at line 96 of file CsvLog.hpp.
|
inline |
Append one CSV row by looking up each column in title_to_value.
| TMap | Map-like supporting operator[](std::string) returning something streamable. |
| nPrecision | Decimal digits used for floating-point output. |
Definition at line 113 of file CsvLog.hpp.
|
inline |
Emit the title row (called automatically on the first WriteLine).
Definition at line 132 of file CsvLog.hpp.