Skip to content

Only print header once per file for CSVSink

Daniel Joseph Antrim requested to merge dantrim/labRemote:csvsink_output into devel

What

This MR fixes the CSVSink class so that it does not print the header (i.e. the measurement name and column/field names) at each call to recordPoint.

It renames the time field in the tags and header to timestamp since the m_timestamp field as it stands now is the time at which startMeasurement is called.

It flushes the output filestream at the end of each call to recordPoint so that the data is written to disk immediately and not deferred. In this way the data is saved even after an early/unexpected exit (e.g. a signal like Ctrl-C is presented).

It also fixes a bug by adding a missing #include "Logger.h" which is needed for using the logger. This was missed since the only other use of it was hidden behind a preprocessor directive which had not been called/exercised.

Related Issues

Relates to #59 (closed).

Edited by Daniel Joseph Antrim

Merge request reports