libqi-api  2.0.6.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
qi::log::FileLogHandler Class Reference

Log messages to a file. More...

#include <fileloghandler.hpp>

List of all members.

Public Member Functions

 FileLogHandler (const std::string &filePath)
 Initialize the file handler on the file. File is opened directly on construction.
virtual ~FileLogHandler ()
 Closes the file.
void log (const qi::LogLevel verb, const qi::os::timeval date, const char *category, const char *msg, const char *file, const char *fct, const int line)
 Writes a log message to the file.

Detailed Description

Log messages to a file.

This class writes all logs to a file.

Definition at line 19 of file fileloghandler.hpp.


Constructor & Destructor Documentation

qi::log::FileLogHandler::FileLogHandler ( 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.
 * 

Closes the file.


Member Function Documentation

qi::log::FileLogHandler::log ( const qi::LogLevel  verb,
const qi::os::timeval  date,
const char *  category,
const char *  msg,
const char *  file,
const char *  fct,
const int  line 
)

Writes a log message to the file.

Parameters:
verbverbosity of the log message.
datedate 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 files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines