Struct carboncopy::Entry[][src]

pub struct Entry { /* fields omitted */ }

Represents a single log entry.

Implementations

impl Entry[src]

pub fn new(
    message: Message,
    timestamp: bool,
    span_id: Option<Vec<u8>>,
    tags: Option<Tags>
) -> Self
[src]

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

impl Clone for Entry[src]

impl Serialize for Entry[src]

Auto Trait Implementations

impl RefUnwindSafe for Entry

impl Send for Entry

impl Sync for Entry

impl Unpin for Entry

impl UnwindSafe for Entry

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.