Class CLogCSVWriter#

Nested Relationships#

Nested Types#

Class Documentation#

class CLogCSVWriter#

Writes CSV entries to a given stream.

Public Functions

CLogCSVWriter(std::shared_ptr<std::ostream> ostream, const char separator = ';')#

Constructs a CSV writer.

Parameters:
  • ostream[in] stream the CSV writer will write to.

  • separator[in] sets the separator of the CSV file, default is ‘;’.

void Write(const std::string &message, const sdv::core::ELogSeverity severity, const std::chrono::time_point<std::chrono::system_clock> timestamp)#

Creates a log entry in the log.

Parameters:
  • message[in] message of the log entry.

  • severity[in] severity of the log entry.

  • timestamp[in] timestamp of the log entry.

std::string GetDateTime(const std::chrono::time_point<std::chrono::system_clock> timestamp)#

Creates a string of the given timestamp including nano seconds.

Parameters:

timestamp[in] Timestamp to be converted to a string.

Returns:

Returns the string representing the timestamp including nano seconds.

Public Static Functions

static std::string GetSeverityString(sdv::core::ELogSeverity severity)#

Creates string from the given severity.

Parameters:

severity[in] Severity to be converted to a string.

Returns:

Returns the string representing the severity.

struct SForbiddenSeparatorException : public std::runtime_error#

Exception if an invalid separator is set.

Public Functions

inline SForbiddenSeparatorException(const char *message)#

Construct a forbidden separator Exception object.

Parameters:

message[in] The reason for throwing this exception.