libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
qi::log::CsvLogHandler Class Reference

#include <csvloghandler.hpp>

Public Member Functions

 CsvLogHandler (const std::string &filePath)
 Initialize the file handler on the file. File is opened directly on construction. More...
 
 ~CsvLogHandler ()
 Closes the file. More...
 
void log (const qi::LogLevel verb, const qi::Clock::time_point date, const qi::SystemClock::time_point systemDate, const char *category, const char *msg, const char *file, const char *fct, const int line)
 Write logs messages on a file. More...
 

Detailed Description

This class writes all logs to a file in csv format.

Definition at line 26 of file csvloghandler.hpp.

Constructor & Destructor Documentation

qi::log::CsvLogHandler::CsvLogHandler ( const std::string &  filePath)
explicit

Initialize the file handler on the file. File is opened directly on construction.

Parameters
filePaththe path to the file where log messages will be written.
* .. warning::
*
*      If the file could not be opened, it logs a warning and every log call
*      will silently fail.
* 
qi::log::CsvLogHandler::~CsvLogHandler ( )

Closes the file.

Member Function Documentation

void qi::log::CsvLogHandler::log ( const qi::LogLevel  verb,
const qi::Clock::time_point  date,
const qi::SystemClock::time_point  systemDate,
const char *  category,
const char *  msg,
const char *  file,
const char *  fct,
const int  line 
)

Write logs messages on a file.

Parameters
verbverbosity of the log message.
dateqi::Clock date at which the log message was issued.
systemDateqi::SystemClock date at which the log message was issued.
categorywill be used in future for filtering
msgactual message to log.
filefilename from which this log message was issued.
fctfunction name from which this log message was issued.
lineline number in the issuer file.

If the file could not be opened, this function will silently fail, otherwise it will directly write the log message to the file and flush its output.


The documentation for this class was generated from the following file: