Appends messages to a file.
More...
#include <RST/log/Sinks/FileSink.hpp>
|
| void | log (const LogMessage &message) override |
| | Writes one message; called with the sink mutex locked.
|
| |
| void | flushSink () override |
| | Flushes the output; called with the sink mutex locked.
|
| |
| std::string_view | formatted (const LogMessage &message) |
| | The message formatted with the sink pattern.
|
| |
| std::mutex & | sinkMutex () noexcept |
| |
Appends messages to a file.
◆ FileSink()
| RST::Log::FileSink::FileSink |
( |
std::string_view |
filepath, |
|
|
bool |
truncate = false |
|
) |
| |
|
explicit |
Opens filepath, emptying it first if truncate is true.
- Exceptions
-
| std::runtime_error | if the file cannot be opened. |
◆ ~FileSink()
| RST::Log::FileSink::~FileSink |
( |
| ) |
|
|
override |
◆ filepath()
| const std::string & RST::Log::FileSink::filepath |
( |
| ) |
const |
|
inlinenoexcept |
◆ log()
| void RST::Log::FileSink::log |
( |
const LogMessage & |
message | ) |
|
|
overrideprotectedvirtual |
Writes one message; called with the sink mutex locked.
Implements RST::Log::ASink.
◆ flushSink()
| void RST::Log::FileSink::flushSink |
( |
| ) |
|
|
overrideprotectedvirtual |
Flushes the output; called with the sink mutex locked.
Reimplemented from RST::Log::ASink.
The documentation for this class was generated from the following file: