pub enum UninitializedLogPolicy {
Stdout,
Stderr,
Buffer {
max_bytes: usize,
},
Discard,
}Expand description
Policy controlling what happens to log messages emitted before a collector
has been initialized via one of the init_*_logger functions.
The default is UninitializedLogPolicy::Stdout, which preserves the
historical behaviour of pretty-printing pre-initialization logs to stdout
(useful for tests run with cargo test -- --nocapture).
Use set_uninitialized_log_policy to change the active policy. Once a
collector is initialized, this policy no longer applies as logs flow to the
collector instead.
Variants§
Stdout
Pretty-print pending logs to stdout, then drop them. Default.
Stderr
Pretty-print pending logs to stderr, then drop them.
Buffer
Retain logs in the in-memory buffer. Once the buffer grows beyond
max_bytes, it is cleared (oldest logs are dropped).
If a collector is later initialized while logs are still buffered, those buffered logs will be picked up by the new collector.
Discard
Drop logs immediately without producing any output.
Trait Implementations§
Source§impl Clone for UninitializedLogPolicy
impl Clone for UninitializedLogPolicy
Source§fn clone(&self) -> UninitializedLogPolicy
fn clone(&self) -> UninitializedLogPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more