Struct sirlog::Log[][src]

pub struct Log {
    pub level: Level,
    pub process: String,
    pub message: String,
    pub timestamp: DateTime<Utc>,
    pub payload: Value,
}

A log entry

Fields

level: Level

The severity of the entry

process: String

The process that generated this entry

message: String

The log message

timestamp: DateTime<Utc>

The timestamp when the entry was created

payload: Value

Structured information that is relevant to the log message

Implementations

impl Log[src]

pub fn new<M: Display>(level: Level, message: M) -> Self[src]

Create a new log entry with the message and level provided

Panics

This must be called when either a global Configuration is set or from within an async task that is executed within Configuration::run()

pub fn error<M: Display>(message: M) -> Self[src]

Create a new log entry with Level::Error and the message provided

Panics

This must be called when either a global Configuration is set or from within an async task that is executed within Configuration::run()

pub fn warning<M: Display>(message: M) -> Self[src]

Create a new log entry with Level::Warning and the message provided

Panics

This must be called when either a global Configuration is set or from within an async task that is executed within Configuration::run()

pub fn info<M: Display>(message: M) -> Self[src]

Create a new log entry with Level::Info and the message provided

Panics

This must be called when either a global Configuration is set or from within an async task that is executed within Configuration::run()

pub fn debug<M: Display>(message: M) -> Self[src]

Create a new log entry with Level::Debug and the message provided

Panics

This must be called when either a global Configuration is set or from within an async task that is executed within Configuration::run()

pub fn trace<M: Display>(message: M) -> Self[src]

Create a new log entry with Level::Trace and the message provided

Panics

This must be called when either a global Configuration is set or from within an async task that is executed within Configuration::run()

pub fn add<K: Into<String>, V: Serialize>(
    &mut self,
    key: K,
    value: V
) -> Result<&mut Self, Error>
[src]

Add extra information to this log entry, useful for attaching information that will help understand the entry or the context in which it was created

pub fn with<K: Into<String>, V: Serialize>(
    self,
    key: K,
    value: V
) -> Result<Self, Error>
[src]

The equivalent of add(), but exposed in a builder-style pattern

pub fn submit(self)[src]

Submits this log entry to the current manager

Panics

  • If no Configuration is available
  • If the manager is not able to receive the log message

Trait Implementations

impl Clone for Log[src]

impl Debug for Log[src]

impl<'de> Deserialize<'de> for Log[src]

impl Eq for Log[src]

impl PartialEq<Log> for Log[src]

impl Serialize for Log[src]

impl StructuralEq for Log[src]

impl StructuralPartialEq for Log[src]

Auto Trait Implementations

impl RefUnwindSafe for Log

impl Send for Log

impl Sync for Log

impl Unpin for Log

impl UnwindSafe for Log

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.