Struct carboncopy::Entry [−][src]
pub struct Entry { /* fields omitted */ }
Represents a single log entry.
Implementations
impl Entry
[src]
impl Entry
[src]pub fn new(
message: Message,
timestamp: bool,
span_id: Option<Vec<u8>>,
tags: Option<Tags>
) -> Self
[src]
message: Message,
timestamp: bool,
span_id: Option<Vec<u8>>,
tags: Option<Tags>
) -> Self
Creates a new log entry.
If timestamp is true, entry is timestamped at Utc::now()
. Otherwise, entry is not
timestamped. Use this option to avoid double timestamping (e.g when using Docker).
When processing the log using a third party log processor, span_id
may be used to group
entries related to the same event together, while tags
may be used to add labels for
categorization.
pub fn brackets_format(self, level: Level) -> String
[src]
Formats the entry into a string with pseudo format:
[%level] [%message] [timestamp: %timestamp] [span_id: %span_id] [tags: %tag1, %tag2]
.
Being optional, timestamp
, span_id
and tags
may not show up at all in the output.
%span_id
is encoded using data_encoding::BASE64URL_NOPAD
.
pub fn json_format(self, level: Level) -> String
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Entry
impl RefUnwindSafe for Entry
impl UnwindSafe for Entry
impl UnwindSafe for Entry