Class representing a logger capable of writing to files.
More...
#include <file_logger.hpp>
|
| file_logger (const logging_config_t &config) |
| File logger constructor. More...
|
|
virtual void | log (const std::string &message, const log_level level) |
|
void | log (const std::string &message) override |
|
| logger (const logging_config_t &config) |
| Logger constructor. More...
|
|
|
void | reopen () |
| Reopen the log file in a thread-safe fashion.
|
|
|
std::string | file_name |
| Name of output file.
|
|
std::ofstream | file |
| Output file stream.
|
|
std::chrono::seconds | reopen_interval |
| Reopen interval in seconds.
|
|
std::chrono::system_clock::time_point | last_reopen |
| Time point when last reopen took place.
|
|
std::mutex | lock |
| Mutex to handle concurrent log writes.
|
|
Class representing a logger capable of writing to files.
◆ file_logger()
file_logger::file_logger |
( |
const logging_config_t & |
config | ) |
|
|
inline |
File logger constructor.
- Parameters
-
config | File logger configuration, which can be used to specify reopen file name and reopen interval |
◆ log() [1/2]
void file_logger::log |
( |
const std::string & |
message | ) |
|
|
inlineoverridevirtual |
◆ log() [2/2]
virtual void file_logger::log |
( |
const std::string & |
message, |
|
|
const log_level |
level |
|
) |
| |
|
inlinevirtual |
The documentation for this class was generated from the following file: