pub struct LoggingBuilder { /* private fields */ }Expand description
Builder for creating logging messages at runtime
Implementations§
Source§impl LoggingBuilder
impl LoggingBuilder
Sourcepub fn new(level: LoggingLevel, data: Value) -> Self
pub fn new(level: LoggingLevel, data: Value) -> Self
Create a new logging builder with the given level and data
Sourcepub fn meta_value(self, key: impl Into<String>, value: Value) -> Self
pub fn meta_value(self, key: impl Into<String>, value: Value) -> Self
Add a meta key-value pair
Sourcepub fn batch_size(self, size: usize) -> Self
pub fn batch_size(self, size: usize) -> Self
Set batch size for log messages
Sourcepub fn build(self) -> LoggingMessageNotification
pub fn build(self) -> LoggingMessageNotification
Build the logging message notification
Sourcepub fn build_dynamic(self) -> DynamicLogger
pub fn build_dynamic(self) -> DynamicLogger
Build a dynamic logger that implements the definition traits
Sourcepub fn build_session_aware(self) -> SessionAwareLogger
pub fn build_session_aware(self) -> SessionAwareLogger
Create session-aware logger that can send messages directly to a session
Source§impl LoggingBuilder
Convenience methods for different log levels
impl LoggingBuilder
Convenience methods for different log levels
Sourcepub fn text(level: LoggingLevel, message: impl Into<String>) -> Self
pub fn text(level: LoggingLevel, message: impl Into<String>) -> Self
Create a simple text log message
Sourcepub fn structured(level: LoggingLevel, fields: HashMap<String, Value>) -> Self
pub fn structured(level: LoggingLevel, fields: HashMap<String, Value>) -> Self
Create a structured log message with fields
Sourcepub fn with_context(
level: LoggingLevel,
message: impl Into<String>,
context: HashMap<String, Value>,
) -> Self
pub fn with_context( level: LoggingLevel, message: impl Into<String>, context: HashMap<String, Value>, ) -> Self
Create a log message with message and context
Sourcepub fn set_level(level: LoggingLevel) -> SetLevelBuilder
pub fn set_level(level: LoggingLevel) -> SetLevelBuilder
Create a set level request builder
Auto Trait Implementations§
impl Freeze for LoggingBuilder
impl RefUnwindSafe for LoggingBuilder
impl Send for LoggingBuilder
impl Sync for LoggingBuilder
impl Unpin for LoggingBuilder
impl UnwindSafe for LoggingBuilder
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