INFM HIL Interface
Interface between Artery simulation and DuTs
|
Logger to log to file, console and as structured data csv More...
#include <InterfaceLogger.h>
Static Public Member Functions | |
static void | initializeLogger (const LoggerConfig &con) |
static void | logMessage (const std::string &msg, LOG_LEVEL level) |
static void | logMessage (const std::string &msg, LOG_LEVEL level, bool writeToFile) |
static void | changeLogLevel (LOG_TYPE typ, LOG_LEVEL level) |
static void | logEvent (sim_interface::SimEvent event) |
Logger to log to file, console and as structured data csv
This logger is a tool with specialized functions to log and store messages for all elements of the Sim_To_DuT_Interface. The logger and all of it's functions are static so it's not necessary to create instances of the logger to write a message. Please notice that the logger has to be initialised in a first call by a valid configuration before using it.
With logger's functionality it's possible to log messages and events during the execution.
The logger will create files if necessary in which the messages will be stored. The message provider can choose if the message should be logged in the file or not. The logger notices old logfiles and will remove them if the real number of logfiles is higher than the configured backup count.
Change the logging level for a specific logger. Because there are multiple loggers you have to select for which type of logger you want to change the level.
type | the type of logger |
level | new level for logging |
|
static |
This function initializes the logger with the given configuration. After calling this function it's possible to log messages and data objects.
con | - a valid configuration |
|
static |
This function logs the event to the data logfiles. There is no need to define a logging level for this operation.
Please notice, that characters like comma or double quotes causes trouble in CSV files and will be replaced by using standard rules.
event | This event will be logged. |
|
static |
Logs the message with consideration of the log level. Please notice that this function will also log the message into a logfile if the file logger accepts the log level. If you explicitly don't want to log this message into the logfile, please use the function below.
msg | message that should be logged |
level | the logging level for this message |
|
static |
Logs the message with consideration of the log level. This function gives you additionally the possibility to prevent that the logger will write your message into the logfile. So if you set the 3rd parameter to 'false' the logger won't log your message into the file even if the log level would have accepted it.
msg | message that should be logged |
level | the logging level for this message |
doNotWriteIntoFile | true, if you don't want to log into the logfile |