pub struct LogTextPresenter<'a> { /* private fields */ }
Expand description
Used to control stringification options of Data
Implementations§
Source§impl<'a> LogTextPresenter<'a>
impl<'a> LogTextPresenter<'a>
Sourcepub fn new(log: &'a Data<Logs>, options: LogTextDisplayOptions) -> Self
pub fn new(log: &'a Data<Logs>, options: LogTextDisplayOptions) -> Self
Creates a new LogTextPresenter with the specified options and log message. This presenter is bound to the lifetime of the underlying log message.
Methods from Deref<Target = Data<Logs>>§
Sourcepub fn msg(&self) -> Option<&str>
pub fn msg(&self) -> Option<&str>
Returns the string log associated with the message, if one exists.
Sourcepub fn payload_message(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
pub fn payload_message(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
If the log has message, returns an exclusive reference to it.
Sourcepub fn payload_keys(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
pub fn payload_keys(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
If the log has structured keys, returns an exclusive reference to them.
Sourcepub fn payload_keys_strings(&self) -> Box<dyn Iterator<Item = String> + '_>
pub fn payload_keys_strings(&self) -> Box<dyn Iterator<Item = String> + '_>
Returns an iterator over the payload keys as strings with the format “key=value”.
Sourcepub fn file_path(&self) -> Option<&str>
pub fn file_path(&self) -> Option<&str>
Returns the file path associated with the message, if one exists.
Sourcepub fn line_number(&self) -> Option<&u64>
pub fn line_number(&self) -> Option<&u64>
Returns the line number associated with the message, if one exists.
Returns the tags associated with the message, if any exist.
Sourcepub fn dropped_logs(&self) -> Option<u64>
pub fn dropped_logs(&self) -> Option<u64>
Returns number of dropped logs if reported in the message.
Sourcepub fn rolled_out_logs(&self) -> Option<u64>
pub fn rolled_out_logs(&self) -> Option<u64>
Returns number of rolled out logs if reported in the message.
Sourcepub fn component_name(&self) -> Cow<'_, str>
pub fn component_name(&self) -> Cow<'_, str>
Returns the component nam. This only makes sense for v1 components.