pub struct FormatterConfig<'a> {
pub format: FormatterFormat<'a>,
pub is_timestamp_available: bool,
}
Expand description
Settings that control how defmt frames should be formatted.
Fields§
§format: FormatterFormat<'a>
The format to use
is_timestamp_available: bool
If true
, then the logs should include a timestamp.
Not all targets can supply a timestamp, and if not, it should be omitted.
Implementations§
Source§impl<'a> FormatterConfig<'a>
impl<'a> FormatterConfig<'a>
Sourcepub fn custom(format: &'a str) -> Self
pub fn custom(format: &'a str) -> Self
Create a new custom formatter config.
This allows the user to supply a custom log-format string. See the “Custom Log Output” section of the defmt book for details of the format.
Sourcepub fn with_timestamp(self) -> Self
pub fn with_timestamp(self) -> Self
Modify a formatter configuration, setting the ‘timestamp available’ flag to true.
Sourcepub fn with_location(self) -> Self
pub fn with_location(self) -> Self
Modify a formatter configuration, setting the ‘with_location’ flag to true.
Do not use this with a custom log formatter.
Trait Implementations§
Source§impl<'a> Debug for FormatterConfig<'a>
impl<'a> Debug for FormatterConfig<'a>
Source§impl<'a> Default for FormatterConfig<'a>
impl<'a> Default for FormatterConfig<'a>
Source§fn default() -> FormatterConfig<'a>
fn default() -> FormatterConfig<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for FormatterConfig<'a>
impl<'a> RefUnwindSafe for FormatterConfig<'a>
impl<'a> Send for FormatterConfig<'a>
impl<'a> Sync for FormatterConfig<'a>
impl<'a> Unpin for FormatterConfig<'a>
impl<'a> UnwindSafe for FormatterConfig<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more