Struct tracing_gelf::Builder[][src]

pub struct Builder { /* fields omitted */ }

A builder for Logger.

Implementations

impl Builder[src]

pub fn additional_field<K: ToString, V: Into<Value>>(
    mut self: Self,
    key: K,
    value: V
) -> Self
[src]

Add a persistent additional field to the GELF messages.

pub fn version<V: ToString>(mut self: Self, version: V) -> Self[src]

Set the GELF version number. Defaults to "1.1".

pub fn line_numbers(mut self: Self, value: bool) -> Self[src]

Set whether line numbers should be logged. Defaults to true.

pub fn file_names(mut self: Self, value: bool) -> Self[src]

Set whether file names should be logged. Defaults to true.

pub fn module_paths(mut self: Self, value: bool) -> Self[src]

Set whether module paths should be logged. Defaults to true.

pub fn reconnection_timeout(mut self: Self, millis: u32) -> Self[src]

Set the reconnection timeout in milliseconds. Defaults to 10 seconds.

pub fn buffer(mut self: Self, length: usize) -> Self[src]

Sets the buffer length. Defaults to 512.

pub fn connect_tcp<T>(
    self,
    addr: T
) -> Result<(Logger, Pin<Box<dyn Future<Output = ()> + Send>>), BuilderError> where
    T: ToSocketAddrs,
    T: Send + Sync + 'static, 
[src]

Return Logger and TCP connection background task.

pub fn init_tcp_with_subscriber<S, T>(
    self,
    addr: T,
    subscriber: S
) -> Result<Pin<Box<dyn Future<Output = ()> + Send>>, BuilderError> where
    S: Subscriber + for<'a> LookupSpan<'a>,
    S: Send + Sync + 'static,
    T: ToSocketAddrs,
    T: Send + Sync + 'static, 
[src]

Initialize logging with a given Subscriber and return TCP connection background task.

pub fn init_tcp<T>(
    self,
    addr: T
) -> Result<Pin<Box<dyn Future<Output = ()> + Send>>, BuilderError> where
    T: ToSocketAddrs,
    T: Send + Sync + 'static, 
[src]

Initialize logging and return TCP connection background task.

pub fn connect_udp<T>(
    self,
    addr: T
) -> Result<(Logger, Pin<Box<dyn Future<Output = ()> + Send>>), BuilderError> where
    T: ToSocketAddrs,
    T: Send + Sync + 'static, 
[src]

Return Logger layer and a UDP connection background task.

pub fn init_udp_with_subscriber<S, T>(
    self,
    addr: T,
    subscriber: S
) -> Result<Pin<Box<dyn Future<Output = ()> + Send>>, BuilderError> where
    S: Subscriber + for<'a> LookupSpan<'a>,
    S: Send + Sync + 'static,
    T: ToSocketAddrs,
    T: Send + Sync + 'static, 
[src]

Initialize logging with a given Subscriber and return UDP connection background task.

pub fn init_udp<T>(
    self,
    addr: T
) -> Result<Pin<Box<dyn Future<Output = ()> + Send>>, BuilderError> where
    T: ToSocketAddrs,
    T: Send + Sync + 'static, 
[src]

Initialize logging and return UDP connection background task.

Trait Implementations

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

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> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.