ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
csvlog.h File Reference
#include <stdarg.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iostream>
#include <ctime>
Include dependency graph for csvlog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CSVLog
 singleton class for logging on the console and in a file, only interact with it via the defined macros More...
 

Macros

#define LOG_T(...)
 log on trace level More...
 
#define LOG_I(...)
 log on info level More...
 
#define LOG_W(...)
 log on warning level More...
 
#define LOG_E(...)
 log on error level More...
 
#define LOG_SET_LVL_FROM_CONSOLE(...)   CSVLog::getInstance().setLogLevelFromConsole()
 change log level via command line input More...
 
#define LOG_SET_LVL_T(...)   CSVLog::getInstance().setLogLevel(CSVLog::_TRACE)
 set log level to trace More...
 
#define LOG_SET_LVL_I(...)   CSVLog::getInstance().setLogLevel(CSVLog::_INFO)
 set log level to info More...
 
#define LOG_SET_LVL_W(...)   CSVLog::getInstance().setLogLevel(CSVLog::_WARNING)
 set log level to warning More...
 
#define LOG_SET_LVL_E(...)   CSVLog::getInstance().setLogLevel(CSVLog::_ERROR)
 set log level to error More...
 
#define LOG_SET_LVL_CONSOLE_T(...)   CSVLog::getInstance().setLogLevelConsole(CSVLog::_TRACE)
 set log level of console to trace More...
 
#define LOG_SET_LVL_CONSOLE_I(...)   CSVLog::getInstance().setLogLevelConsole(CSVLog::_INFO)
 set log level of console to info More...
 
#define LOG_SET_LVL_CONSOLE_W(...)   CSVLog::getInstance().setLogLevelConsole(CSVLog::_WARNING)
 set log level of console to warning More...
 
#define LOG_SET_LVL_CONSOLE_E(...)   CSVLog::getInstance().setLogLevelConsole(CSVLog::_ERROR)
 set log level of console to error More...
 
#define LOG_SET_LVL_FILE_T(...)   CSVLog::getInstance().setLogLevelFile(CSVLog::_TRACE)
 set log level of file to trace More...
 
#define LOG_SET_LVL_FILE_I(...)   CSVLog::getInstance().setLogLevelFile(CSVLog::_INFO)
 set log level of file to info More...
 
#define LOG_SET_LVL_FILE_W(...)   CSVLog::getInstance().setLogLevelFile(CSVLog::_WARNING)
 set log level of file to warning More...
 
#define LOG_SET_LVL_FILE_E(...)   CSVLog::getInstance().setLogLevelFile(CSVLog::_ERROR)
 set log level of file to error More...
 
#define LOG_SET_SEPERATOR(char_seperator)   CSVLog::getInstance().setSeperator(char_seperator)
 set seperator for file log More...
 
#define LOG_SET_MAXLINES_FILE(int_maxLines)   CSVLog::getInstance().setMaxLinesFile(int_maxLines)
 set max lines per file before a new file is generated More...
 
#define LOG_SET_MAXLINES_BUFFER(int_maxLines)   CSVLog::getInstance().setMaxLinesBuffer(int_maxLines)
 set max lines in buffer before buffer is written to file More...
 
#define LOG_SET_TIMESTAMPVERSION(timestampversion_tsv)   CSVLog::getInstance().setTimestampVersion(timestampversion_tsv)
 set time stamp version (0 for time of day or 1 for epoch) More...
 
#define LOG_SET_LOWTHROUGHPUTMODE(bool_active)   CSVLog::getInstance().setLowThroughputMode(bool_active)
 in low throughput mode, the buffer is written to the file after a certain maximum time even if the buffer is not full More...
 
#define LOG_SET_MAXTIMEBETWEENWRITES(double_time_seconds)   CSVLog::getInstance().setTimeBetweenWrites(double_time_seconds)
 maximum time between writing the buffer to the file in low throughput mode More...
 
#define LOG_INIT(string_filename)   CSVLog::getInstance().init(string_filename)
 initiates writing to a file More...
 

Macro Definition Documentation

◆ LOG_E

#define LOG_E (   ...)
Value:
void logErrorConsole(const char *format,...)
log on error level in console
Definition: csvlog.cpp:155
@ _ERROR
Definition: csvlog.h:211
static LogLevel & getCurrentLogLevelConsole()
get current log level for console log
Definition: csvlog.cpp:89
static CSVLog & getInstance()
Get the singleton object of CSVLog.
Definition: csvlog.cpp:25
static LogLevel & getCurrentLogLevelFile()
get current log level for file log
Definition: csvlog.cpp:83
void logErrorFile(const char *format,...)
log on error level in file
Definition: csvlog.cpp:160

log on error level

◆ LOG_I

#define LOG_I (   ...)
Value:
void logInfoFile(const char *format,...)
log on info level in file
Definition: csvlog.cpp:128
@ _INFO
Definition: csvlog.h:209
void logInfoConsole(const char *format,...)
log on info level in console
Definition: csvlog.cpp:123

log on info level

◆ LOG_INIT

#define LOG_INIT (   string_filename)    CSVLog::getInstance().init(string_filename)

initiates writing to a file

◆ LOG_SET_LOWTHROUGHPUTMODE

#define LOG_SET_LOWTHROUGHPUTMODE (   bool_active)    CSVLog::getInstance().setLowThroughputMode(bool_active)

in low throughput mode, the buffer is written to the file after a certain maximum time even if the buffer is not full

◆ LOG_SET_LVL_CONSOLE_E

#define LOG_SET_LVL_CONSOLE_E (   ...)    CSVLog::getInstance().setLogLevelConsole(CSVLog::_ERROR)

set log level of console to error

◆ LOG_SET_LVL_CONSOLE_I

#define LOG_SET_LVL_CONSOLE_I (   ...)    CSVLog::getInstance().setLogLevelConsole(CSVLog::_INFO)

set log level of console to info

◆ LOG_SET_LVL_CONSOLE_T

#define LOG_SET_LVL_CONSOLE_T (   ...)    CSVLog::getInstance().setLogLevelConsole(CSVLog::_TRACE)

set log level of console to trace

◆ LOG_SET_LVL_CONSOLE_W

#define LOG_SET_LVL_CONSOLE_W (   ...)    CSVLog::getInstance().setLogLevelConsole(CSVLog::_WARNING)

set log level of console to warning

◆ LOG_SET_LVL_E

#define LOG_SET_LVL_E (   ...)    CSVLog::getInstance().setLogLevel(CSVLog::_ERROR)

set log level to error

◆ LOG_SET_LVL_FILE_E

#define LOG_SET_LVL_FILE_E (   ...)    CSVLog::getInstance().setLogLevelFile(CSVLog::_ERROR)

set log level of file to error

◆ LOG_SET_LVL_FILE_I

#define LOG_SET_LVL_FILE_I (   ...)    CSVLog::getInstance().setLogLevelFile(CSVLog::_INFO)

set log level of file to info

◆ LOG_SET_LVL_FILE_T

#define LOG_SET_LVL_FILE_T (   ...)    CSVLog::getInstance().setLogLevelFile(CSVLog::_TRACE)

set log level of file to trace

◆ LOG_SET_LVL_FILE_W

#define LOG_SET_LVL_FILE_W (   ...)    CSVLog::getInstance().setLogLevelFile(CSVLog::_WARNING)

set log level of file to warning

◆ LOG_SET_LVL_FROM_CONSOLE

#define LOG_SET_LVL_FROM_CONSOLE (   ...)    CSVLog::getInstance().setLogLevelFromConsole()

change log level via command line input

◆ LOG_SET_LVL_I

#define LOG_SET_LVL_I (   ...)    CSVLog::getInstance().setLogLevel(CSVLog::_INFO)

set log level to info

◆ LOG_SET_LVL_T

#define LOG_SET_LVL_T (   ...)    CSVLog::getInstance().setLogLevel(CSVLog::_TRACE)

set log level to trace

◆ LOG_SET_LVL_W

#define LOG_SET_LVL_W (   ...)    CSVLog::getInstance().setLogLevel(CSVLog::_WARNING)

set log level to warning

◆ LOG_SET_MAXLINES_BUFFER

#define LOG_SET_MAXLINES_BUFFER (   int_maxLines)    CSVLog::getInstance().setMaxLinesBuffer(int_maxLines)

set max lines in buffer before buffer is written to file

◆ LOG_SET_MAXLINES_FILE

#define LOG_SET_MAXLINES_FILE (   int_maxLines)    CSVLog::getInstance().setMaxLinesFile(int_maxLines)

set max lines per file before a new file is generated

◆ LOG_SET_MAXTIMEBETWEENWRITES

#define LOG_SET_MAXTIMEBETWEENWRITES (   double_time_seconds)    CSVLog::getInstance().setTimeBetweenWrites(double_time_seconds)

maximum time between writing the buffer to the file in low throughput mode

◆ LOG_SET_SEPERATOR

#define LOG_SET_SEPERATOR (   char_seperator)    CSVLog::getInstance().setSeperator(char_seperator)

set seperator for file log

◆ LOG_SET_TIMESTAMPVERSION

#define LOG_SET_TIMESTAMPVERSION (   timestampversion_tsv)    CSVLog::getInstance().setTimestampVersion(timestampversion_tsv)

set time stamp version (0 for time of day or 1 for epoch)

◆ LOG_T

#define LOG_T (   ...)
Value:
@ _TRACE
Definition: csvlog.h:208
void logTraceFile(const char *format,...)
log on trace level in file
Definition: csvlog.cpp:112
void logTraceConsole(const char *format,...)
log on trace level in console
Definition: csvlog.cpp:107

log on trace level

◆ LOG_W

#define LOG_W (   ...)
Value:
@ _WARNING
Definition: csvlog.h:210
void logWarningConsole(const char *format,...)
log on warning level in console
Definition: csvlog.cpp:139
void logWarningFile(const char *format,...)
log on warning level in file
Definition: csvlog.cpp:144

log on warning level