A class version of tail -f
, otherwise known as tail -f
at home.
More...
#include <wpi/FileLogger.h>
|
static std::function< void(std::string_view)> | Buffer (std::function< void(std::string_view)> callback) |
| Creates a function that chunks incoming data into blocks of whole lines and stores incomplete lines to add to the next block of data.
|
|
A class version of tail -f
, otherwise known as tail -f
at home.
Watches a file and puts the data somewhere else. Only works on Linux-based platforms.
◆ FileLogger() [1/4]
wpi::FileLogger::FileLogger |
( |
| ) |
|
|
default |
◆ FileLogger() [2/4]
wpi::FileLogger::FileLogger |
( |
std::string_view | file, |
|
|
std::function< void(std::string_view)> | callback ) |
Construct a FileLogger.
When the specified file is modified, the callback will be called with the appended changes.
- Parameters
-
file | The path to the file. |
callback | A callback that accepts the appended file data. |
◆ FileLogger() [3/4]
wpi::FileLogger::FileLogger |
( |
std::string_view | file, |
|
|
log::DataLog & | log, |
|
|
std::string_view | key ) |
Construct a FileLogger.
When the specified file is modified, appended data will be appended to the specified data log.
- Parameters
-
file | The path to the file. |
log | A data log. |
key | The log key to append data to. |
◆ FileLogger() [4/4]
wpi::FileLogger::FileLogger |
( |
FileLogger && | other | ) |
|
◆ ~FileLogger()
wpi::FileLogger::~FileLogger |
( |
| ) |
|
◆ Buffer()
static std::function< void(std::string_view)> wpi::FileLogger::Buffer |
( |
std::function< void(std::string_view)> | callback | ) |
|
|
static |
Creates a function that chunks incoming data into blocks of whole lines and stores incomplete lines to add to the next block of data.
- Parameters
-
callback | A callback that accepts the blocks of whole lines. |
- Returns
- The function.
◆ operator=()
The documentation for this class was generated from the following file: