From b24d4a4523164aa69013d4327ca9faae484fa844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjell=20Hedstr=C3=B6m?= <331742+KjellKod@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:55:24 -0600 Subject: [PATCH] update doc for default flush (#499) --- docs/API.md | 6 ++++-- test_unit/test_io.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/API.md b/docs/API.md index 17c8806..1416063 100644 --- a/docs/API.md +++ b/docs/API.md @@ -116,7 +116,9 @@ Please see[API_custom_formatting.md](API_custom_formatting.md) ## LOG flushing -The default file sink will flush each log entry as it comes in. For different flushing policies please take a look at g3sinks [logrotate and LogRotateWithFilters](https://github.com/KjellKod/g3sinks/tree/master/sink_logrotate). +The default file sink will flush each log entry at set intervals. The default buffer size for flushing is set to 100 entries. You can adjust this down to 1, or as high as makes sense for your system. Please see [FileSink](https://github.com/KjellKod/g3log/blob/master/src/g3log/filesink.hpp#L18) + +Even more flushing policies and log rotations can be found at g3sinks [logrotate and LogRotateWithFilters](https://github.com/KjellKod/g3sinks/tree/master/sink_logrotate). At shutdown all enqueued logs will be flushed to the sink. At a discovered fatal event (SIGSEGV et.al) all enqueued logs will be flushed to the sink. @@ -253,4 +255,4 @@ The default behaviour for G3log is to catch several fatal events before they for An example of a Windows stackdump as shown in the output from the fatal example g3log-FATAL-sigsegv. -[introduction](index.md) | [detailed information](g3log.md) | [Configure & Build](building.md) | [**API description**](API.md) | [Custom log formatting](API_custom_formatting.md) \ No newline at end of file +[introduction](index.md) | [detailed information](g3log.md) | [Configure & Build](building.md) | [**API description**](API.md) | [Custom log formatting](API_custom_formatting.md) diff --git a/test_unit/test_io.cpp b/test_unit/test_io.cpp index 61646d7..f6ca1b5 100644 --- a/test_unit/test_io.cpp +++ b/test_unit/test_io.cpp @@ -20,6 +20,7 @@ #include #include #include +#include namespace { const std::string log_directory = "./";