- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

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

Keeps at most 2 MiB of logs. . More...

`#include <tailfileloghandler.hpp>`

## Public Member Functions
| TailFileLogHandler (const std::string &filePath)
| Initialize the tail file log handler. File is opened on construction. More...
virtual | ~TailFileLogHandler ()
| 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)
| Writes the log message to the file. More...

## Detailed Description

Keeps at most 2 MiB of logs. .

    * This class writes the logs to a file. When more than 1 MiB are written, it
    * moves the file to *filePath*.old, truncates *filePath*, and keeps writing
    * inside it. This means that you will get at most the last 2 MiB logged by
    * :cpp:class:`qi::log::TailFileLogHandler`.
    *

Definition at line 32 of file tailfileloghandler.hpp.

## Constructor & Destructor Documentation

qi::log::TailFileLogHandler::TailFileLogHandler | ( | const std::string & | filePath | ) |

Initialize the tail file log handler. File is opened on construction.

Parameters

  filePath | path to the file.

    * .. warning::
    *
    *      If the file could not be opened, it logs a warning and every log call
    *      will silently fail.
    *

virtual qi::log::TailFileLogHandler::~TailFileLogHandler | ( |  | ) |
| virtual

Closes the file.

## Member Function Documentation

void qi::log::TailFileLogHandler::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
| ) |  |

Writes the log message to the file.

Parameters

  verb | verbosity of the log message.
  date | qi::Clock date at which the log message was issued.
  date | qi::SystemClock date at which the log message was issued.
  category | will be used in future for filtering
  msg | message to log.
  file | filename in the sources from which this log message was issued.
  fct | function name from which this log message was issued.
  line | line 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. see detailed description for more details on what "tail" means.

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

- /home/opennao/work/release-2.8/sdk/libqi/qi/log/tailfileloghandler.hpp