Struct sirlog::Log [−][src]
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]
&mut self,
key: K,
value: V
) -> Result<&mut Self, Error>
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]
self,
key: K,
value: V
) -> Result<Self, Error>
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Log
[src]
impl PartialEq<Log> for Log
[src]
impl Serialize for Log
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,