Open Thomasdezeeuw opened 3 years ago
The maximum number of iovec
on most OSes is 1024, as defined by the following
#[cfg(any(
target_os = "dragonfly",
target_os = "freebsd",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
))]
const MAX_BUFS: usize = libc::IOV_MAX as usize;
#[cfg(any(target_os = "android", target_os = "emscripten", target_os = "linux"))]
const MAX_BUFS: usize = libc::UIO_MAXIOV as usize;
Currently the formatting of key-value pairs doesn't use vectored I/O, but it could. Related code:
https://github.com/Thomasdezeeuw/std-logger/blob/4d2a531d18c37aa7aa179d230c522d2a61cc3096/src/format.rs#L125-L132
https://github.com/Thomasdezeeuw/std-logger/blob/4d2a531d18c37aa7aa179d230c522d2a61cc3096/src/format.rs#L228-L265