SyslogBuilder

Struct SyslogBuilder 

Source
pub struct SyslogBuilder { /* private fields */ }
Expand description

Builder used to create and customize the Syslog logger object.

Implementations§

Source§

impl SyslogBuilder

Source

pub fn build(self) -> Syslog

Consumes self and returns a freshly created Syslog logger object. To be called at the end of the builder chain, after all other methods on the SyslogBuilder object.

Source

pub fn facility(self, facility: Facility) -> Self

Sets logging facility to given Facility value.

Source

pub fn facility_raw(self, facility: c_int) -> Self

Sets logging facility to unchecked c_int value. Can be used for setting a raw libsyslog-sys constant directly.

Source

pub fn ident<T: Into<Vec<u8>>>(self, ident: T) -> Result<Self, NulError>

Sets ident to the string like argument provided. By default ident is derived from the name of the executable.

Source

pub fn level(self, level: LevelFilter) -> Self

Sets global log level to be used when no module_level rule matches.

Source

pub fn logopt(self, logopt: Logopt) -> Self

Sets logopt to to given Logopt value.

Source

pub fn logopt_raw(self, logopt: c_int) -> Self

Sets logopt to unchecked c_int value. Can be used for setting a raw libsyslog-sys constant directly.

Source

pub fn module_level(self, target: &str, level: LevelFilter) -> Self

Sets log level for specified target Rust module. Multiple calls to this method is possible and will set multiple filters. More specific filters on children will override those of their parent modules.

Trait Implementations§

Source§

impl Debug for SyslogBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SyslogBuilder

Source§

fn default() -> SyslogBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.