[][src]Struct tracing_gelf::Builder

pub struct Builder { /* fields omitted */ }

A builder for Logger.

Methods

impl Builder[src]

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

Add a persistent additional field to the GELF messages.

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

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

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

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

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

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

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

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

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

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

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

Sets the buffer length. Defaults to 512.

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

Return Logger and TCP connection background task.

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

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

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

Initialize logging and return TCP connection background task.

pub fn connect_udp(
    self,
    addr: SocketAddr
) -> Result<(Logger, Pin<Box<dyn Future<Output = ()> + Send>>), BuilderError>
[src]

Return Logger layer and a UDP connection background task.

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

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

pub fn init_udp<A>(
    self,
    addr: SocketAddr
) -> Result<Pin<Box<dyn Future<Output = ()> + Send>>, BuilderError>
[src]

Initialize logging and return UDP connection background task.

Trait Implementations

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

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, 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.