From d18804e0bd2c05cb1cb31bbf2eef8709e45455cc Mon Sep 17 00:00:00 2001 From: Mattias Flodin Date: Wed, 31 Aug 2016 21:18:42 +0200 Subject: [PATCH] Document stdout_/stderr_writer --- doc/manual.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/manual.md b/doc/manual.md index 0c2e8a7..87b3da4 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -6,6 +6,7 @@ Table of Contents - [severity_log](#severity_log) - [Custom writers](#custom-writers) - [file_writer](#file_writer) +- [stdout_writer and stderr_writer](#stdout_writer-and-stderr_writer) - [Custom string formatting](#custom-string-formatting) - [output_buffer](#output_buffer) - [Custom fields in policy_log](#custom-fields-in-policy_log) @@ -437,6 +438,28 @@ On Linux, the writer classifies following error codes as temporary errors: EDQUOT (user quota reached), EIO (low-level I/O error). All other errors are classified as permanent. +stdout_writer and stderr_writer +=============================== +`stdout_writer` and `stderr_writer` write to the respective standard streams. + +```c++ +// #include + +class stdout_writer : public writer { +public: + stdout_writer(); + std::size_t write(void const* pbuffer, std::size_t count, + std::error_code& ec) noexcept override; +}; + +class stderr_writer : public writer { +public: + stderr_writer(); + std::size_t write(void const* pbuffer, std::size_t count, + std::error_code& ec) noexcept override; +}; +``` + Custom string formatting ================================================ Both `policy_log` and `severity_log` make use of the `template_formatter`