|
qxLib
|
High-performance file logger based on memory-mapped I/O. More...
#include <file_logger_stream_mapping.h>
Public Member Functions | |
| file_logger_stream_mapping (const config &streamConfig=config(), unit< size_t, units::data > initialMapSize={ 1, units::data::mebibytes }) noexcept | |
| file_logger_stream_mapping object constructor More... | |
| virtual void | do_log (const category &category, verbosity eVerbosity, string_view svMessage) override |
| Proceed stream logging. More... | |
| virtual void | do_flush () override |
| Flush the stream. | |
Public Member Functions inherited from qx::base_file_logger_stream | |
| base_file_logger_stream (const config &streamConfig) noexcept | |
| file_logger_stream object constructor More... | |
Public Member Functions inherited from qx::base_logger_stream | |
| base_logger_stream (const config &streamConfig) noexcept | |
| base_logger_stream object constructor More... | |
| void | log (const category &category, verbosity eVerbosity, string_view svMessage) |
| Output to stream. More... | |
| void | flush () |
| Flush the stream. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from qx::base_file_logger_stream | |
| static std::filesystem::path | create_folder_and_get_log_file_path (log_file_policy eLogFilePolicy, string_view svFileName) noexcept |
| Create a folder (if required) and get log file path. More... | |
High-performance file logger based on memory-mapped I/O.
This logger implementation writes log data directly into a memory-mapped file region (mmap / CreateFileMapping). Instead of using traditional buffered I/O (fopen / WriteFile), the file is mapped into the process address space and written via simple memory copies.
UTF-8 LE (char) or UTF-16 LE (wchar_t).
While the file is open for writing, a sequence of NUL characters appears at the end of the file. This is expected and follows the logic of how memory-mapped files work. These characters will be truncated when the object is destroyed, usually when an application is closed.
Definition at line 45 of file file_logger_stream_mapping.h.
|
inlinenoexcept |
file_logger_stream_mapping object constructor
| streamConfig | - file logger configuration |
| initialMapSize | - initial mapping size (outer capacity). mapping grows when needed |
Definition at line 13 of file file_logger_stream_mapping.inl.
|
inlineoverridevirtual |
Proceed stream logging.
| eVerbosity | - this message verbosity |
| category | - code category |
| svMessage | - message string |
Implements qx::base_logger_stream.
Definition at line 140 of file file_logger_stream_mapping.inl.