Skip to content

feat(sinks): custom setvbuf buffer size for file sinks (#1799) - #3645

Open
rachelwelchio wants to merge 6 commits into
gabime:v1.xfrom
rachelwelchio:feat/file-buffer-size-1799
Open

feat(sinks): custom setvbuf buffer size for file sinks (#1799)#3645
rachelwelchio wants to merge 6 commits into
gabime:v1.xfrom
rachelwelchio:feat/file-buffer-size-1799

Conversation

@rachelwelchio

Copy link
Copy Markdown

Summary

Adds optional custom setvbuf buffer sizing for file sinks (#1799).

  • details::file_helper::set_buffer(size)
  • basic_file_sink / rotating_file_sink expose set_buffer and optional ctor/basic_logger_* buffer_size (default 0 = unchanged)

Larger buffers can reduce syscall pressure when writing many files.

Test plan

  • Default buffer_size=0 preserves previous behavior
  • Non-zero buffer applies _IOFBF via setvbuf after open/reopen
  • Failed setvbuf throws spdlog_ex

Closes #1799

Signed-off-by: rachelwelchio <rachelwelchio@users.noreply.github.com>
Signed-off-by: rachelwelchio <rachelwelchio@users.noreply.github.com>
Signed-off-by: rachelwelchio <rachelwelchio@users.noreply.github.com>
Signed-off-by: rachelwelchio <rachelwelchio@users.noreply.github.com>
Signed-off-by: rachelwelchio <rachelwelchio@users.noreply.github.com>
Signed-off-by: rachelwelchio <rachelwelchio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom BUFSIZ support

1 participant