pub struct IntervalLogWriterBuilder { /* private fields */ }
Expand description
Prepare an IntervalLogWriter
.
This type only allows writing comments and headers. Once you’re done writing those things, use
into_log_writer()
to convert this into an IntervalLogWriter
.
Implementations§
source§impl IntervalLogWriterBuilder
impl IntervalLogWriterBuilder
sourcepub fn new() -> IntervalLogWriterBuilder
pub fn new() -> IntervalLogWriterBuilder
Create a new log writer that writes to writer
and serializes histograms with serializer
.
sourcepub fn add_comment(&mut self, s: &str) -> &mut Self
pub fn add_comment(&mut self, s: &str) -> &mut Self
Add a comment line to be written when the writer is built.
Comments containing ‘\n’ will be transformed into multiple lines of comments.
sourcepub fn with_start_time(&mut self, time: SystemTime) -> &mut Self
pub fn with_start_time(&mut self, time: SystemTime) -> &mut Self
Set a StartTime. See the module-level documentation for more info.
This can be called multiple times, but only the value for the most recent invocation will be written.
sourcepub fn with_base_time(&mut self, time: SystemTime) -> &mut Self
pub fn with_base_time(&mut self, time: SystemTime) -> &mut Self
Set a BaseTime. See the module-level documentation for more info.
This can be called multiple times, but only the value for the most recent invocation will be written.
sourcepub fn with_max_value_divisor(&mut self, max_value_divisor: f64) -> &mut Self
pub fn with_max_value_divisor(&mut self, max_value_divisor: f64) -> &mut Self
Set a max value divisor.
This is used to scale down the max value part of an interval log to something that may be more human readable. The max value in the log is only for human consumption, so you might prefer to divide by 109 to turn nanoseconds into fractional seconds, for instance.
If this is not set, 1.0 will be used.
This can be called multiple times, but only the value for the most recent invocation will be written.
sourcepub fn begin_log_with<'a, 'b, W: 'a + Write, S: 'b + Serializer>(
&self,
writer: &'a mut W,
serializer: &'b mut S,
) -> Result<IntervalLogWriter<'a, 'b, W, S>, Error>
pub fn begin_log_with<'a, 'b, W: 'a + Write, S: 'b + Serializer>( &self, writer: &'a mut W, serializer: &'b mut S, ) -> Result<IntervalLogWriter<'a, 'b, W, S>, Error>
Build a LogWriter and apply any configured headers.