pub struct LogEntry {
pub id: LogId,
pub timestamp: DateTime<Utc>,
pub level: LogLevel,
pub module: String,
pub message: String,
pub metadata: Option<Value>,
pub user_id: UserId,
pub session_id: SessionId,
pub task_id: Option<TaskId>,
pub trace_id: TraceId,
pub context_id: Option<ContextId>,
pub client_id: Option<ClientId>,
}Fields§
§id: LogId§timestamp: DateTime<Utc>§level: LogLevel§module: String§message: String§metadata: Option<Value>§user_id: UserId§session_id: SessionId§task_id: Option<TaskId>§trace_id: TraceId§context_id: Option<ContextId>§client_id: Option<ClientId>Implementations§
Source§impl LogEntry
impl LogEntry
pub fn new( level: LogLevel, module: impl Into<String>, message: impl Into<String>, ) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
pub fn with_user_id(self, user_id: UserId) -> Self
pub fn with_session_id(self, session_id: SessionId) -> Self
pub fn with_task_id(self, task_id: TaskId) -> Self
pub fn with_trace_id(self, trace_id: TraceId) -> Self
pub fn with_context_id(self, context_id: ContextId) -> Self
pub fn with_client_id(self, client_id: ClientId) -> Self
pub fn validate(&self) -> Result<(), LoggingError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogEntry
impl<'de> Deserialize<'de> for LogEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LogEntry
impl RefUnwindSafe for LogEntry
impl Send for LogEntry
impl Sync for LogEntry
impl Unpin for LogEntry
impl UnwindSafe for LogEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.