Lines Matching refs:format
219 //! ## Tweaking the default format
221 //! Parts of the default format can be excluded from the log output using the [`Builder`].
230 //! ### Stability of the default format
232 //! The default format won't optimise for long-term stability, and explicitly makes no
237 //! then you should use a custom format.
239 //! ### Using a custom format
248 //! .format(|buf, record| {
350 format: FormatFn,
355 /// It can be used to customize the log format, change the environment variable used
369 /// .format(|buf, record| writeln!(buf, "{} - {}", record.level(), record.args()))
380 format: fmt::Builder,
553 /// Sets the format function for formatting the log output.
555 /// This function is called on each record logged and should format the
558 /// The format function is expected to output the string directly to the
560 /// to format and output without intermediate heap allocations. The default
565 /// Use a custom format to write only the log message:
573 /// builder.format(|buf, record| writeln!(buf, "{}", record.args()));
579 pub fn format<F: 'static>(&mut self, format: F) -> &mut Self
583 self.format.custom_format = Some(Box::new(format));
587 /// Use the default format.
589 /// This method will clear any custom format set on the builder.
591 self.format = Default::default();
595 /// Whether or not to write the level in the default format.
597 self.format.format_level = write;
601 /// Whether or not to write the module path in the default format.
603 self.format.format_module_path = write;
607 /// Whether or not to write the target in the default format.
609 self.format.format_target = write;
616 self.format.format_indent = indent;
622 self.format.format_timestamp = timestamp;
648 self.format.format_suffix = suffix;
830 format: self.format.build(),
924 (self.format)(formatter, record).and_then(|_| formatter.print(&self.writer));