Struct tracing_gelf::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for Logger
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn additional_field<K, V>(self, key: K, value: V) -> Self
pub fn additional_field<K, V>(self, key: K, value: V) -> Self
Adds a persistent additional field to the GELF messages.
sourcepub fn version<V>(self, version: V) -> Selfwhere
V: ToString,
pub fn version<V>(self, version: V) -> Selfwhere
V: ToString,
Sets the GELF version number. Defaults to “1.1”.
sourcepub fn host<V>(self, host: V) -> Selfwhere
V: ToString,
pub fn host<V>(self, host: V) -> Selfwhere
V: ToString,
Sets the host
field. Defaults to the system’s host name.
sourcepub fn line_numbers(self, value: bool) -> Self
pub fn line_numbers(self, value: bool) -> Self
Sets whether line numbers should be logged. Defaults to true.
sourcepub fn file_names(self, value: bool) -> Self
pub fn file_names(self, value: bool) -> Self
Sets whether file names should be logged. Defaults to true.
sourcepub fn module_paths(self, value: bool) -> Self
pub fn module_paths(self, value: bool) -> Self
Sets whether module paths should be logged. Defaults to true.
sourcepub fn connect_udp<A>(
self,
addr: A
) -> Result<(Logger, ConnectionHandle<A, UdpConnection>), BuilderError>
pub fn connect_udp<A>( self, addr: A ) -> Result<(Logger, ConnectionHandle<A, UdpConnection>), BuilderError>
Returns a Logger
and its UDP ConnectionHandle
.
sourcepub fn connect_tcp<A>(
self,
addr: A
) -> Result<(Logger, ConnectionHandle<A, TcpConnection>), BuilderError>
pub fn connect_tcp<A>( self, addr: A ) -> Result<(Logger, ConnectionHandle<A, TcpConnection>), BuilderError>
Returns a Logger
and its TCP ConnectionHandle
.
sourcepub fn init_udp_with_subscriber<S, A>(
self,
addr: A,
subscriber: S
) -> Result<ConnectionHandle<A, UdpConnection>, BuilderError>where
S: Subscriber + for<'a> LookupSpan<'a> + Send + Sync + 'static,
A: ToSocketAddrs + Send + Sync + 'static,
pub fn init_udp_with_subscriber<S, A>(
self,
addr: A,
subscriber: S
) -> Result<ConnectionHandle<A, UdpConnection>, BuilderError>where
S: Subscriber + for<'a> LookupSpan<'a> + Send + Sync + 'static,
A: ToSocketAddrs + Send + Sync + 'static,
Initialize logging with a given Subscriber
and returns its UDP ConnectionHandle
.
sourcepub fn init_tcp_with_subscriber<A, S>(
self,
addr: A,
subscriber: S
) -> Result<ConnectionHandle<A, TcpConnection>, BuilderError>where
A: ToSocketAddrs + Send + Sync + 'static,
S: Subscriber + for<'a> LookupSpan<'a> + Send + Sync + 'static,
pub fn init_tcp_with_subscriber<A, S>(
self,
addr: A,
subscriber: S
) -> Result<ConnectionHandle<A, TcpConnection>, BuilderError>where
A: ToSocketAddrs + Send + Sync + 'static,
S: Subscriber + for<'a> LookupSpan<'a> + Send + Sync + 'static,
Initializes logging with a given Subscriber
and returns its TCP ConnectionHandle
.
sourcepub fn init_tcp<A>(
self,
addr: A
) -> Result<ConnectionHandle<A, TcpConnection>, BuilderError>
pub fn init_tcp<A>( self, addr: A ) -> Result<ConnectionHandle<A, TcpConnection>, BuilderError>
Initializes TCP logging and returns its ConnectionHandle
.
sourcepub fn init_udp<A>(
self,
addr: A
) -> Result<ConnectionHandle<A, UdpConnection>, BuilderError>
pub fn init_udp<A>( self, addr: A ) -> Result<ConnectionHandle<A, UdpConnection>, BuilderError>
Initialize UDP logging and returns its ConnectionHandle
.
Trait Implementations§
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§
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