pub struct BatchingLogClient { /* private fields */ }Expand description
LogClient built from a LogExporter, BatchOptions, resource and redaction.
Cheap to clone; clones share the queue.
Implementations§
Source§impl BatchingLogClient
impl BatchingLogClient
Sourcepub fn builder(exporter: Arc<dyn LogExporter>) -> BatchingLogClientBuilder
pub fn builder(exporter: Arc<dyn LogExporter>) -> BatchingLogClientBuilder
Starts building a client around exporter.
Sourcepub fn new(exporter: Arc<dyn LogExporter>) -> Result<Self>
pub fn new(exporter: Arc<dyn LogExporter>) -> Result<Self>
Client with default options.
Sourcepub fn processor(&self) -> &BatchProcessor
pub fn processor(&self) -> &BatchProcessor
The underlying processor.
Sourcepub fn prepare(&self, entry: LogEntry) -> LogRecord
pub fn prepare(&self, entry: LogEntry) -> LogRecord
Applies defaults, trace correlation and redaction, producing the record that is queued.
Sourcepub async fn send_async(&self, entry: LogEntry) -> bool
pub async fn send_async(&self, entry: LogEntry) -> bool
Sends and waits for room under the Block policy instead of blocking the thread.
Trait Implementations§
Source§impl Clone for BatchingLogClient
impl Clone for BatchingLogClient
Source§impl Debug for BatchingLogClient
impl Debug for BatchingLogClient
Source§impl LogClient for BatchingLogClient
impl LogClient for BatchingLogClient
Source§fn send(&self, entry: LogEntry)
fn send(&self, entry: LogEntry)
Enqueues one record (applies redaction and defaults). Never blocks unless the batch
drop policy is
Block.Source§fn flush<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
timeout: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Exports everything queued now.
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flushes and shuts down; idempotent.
Source§fn stats(&self) -> BatchStats
fn stats(&self) -> BatchStats
Batch counters.
Source§fn send_batch(&self, entries: Vec<LogEntry>)
fn send_batch(&self, entries: Vec<LogEntry>)
Enqueues several records.
Auto Trait Implementations§
impl !RefUnwindSafe for BatchingLogClient
impl !UnwindSafe for BatchingLogClient
impl Forget for BatchingLogClient
impl Freeze for BatchingLogClient
impl Move for BatchingLogClient
impl Send for BatchingLogClient
impl Sync for BatchingLogClient
impl Unpin for BatchingLogClient
impl UnsafeUnpin for BatchingLogClient
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