Trait slog_config::DrainFactory
[−]
[src]
pub trait DrainFactory {
fn from_config(&self, config: &Output) -> Result<Option<Drain>, String>;
}Drain type handler
This is an interface between slog-config and handler of particular type of the drain that can
be described in the config.
slog-config builds a Drain by quering each element of list of DrainFactory-ies.
By implementing this type external code can be used to extend possible interpret a piece of config and produce
each piece of a resulting Drain.
See from_config_with
Required Methods
fn from_config(&self, config: &Output) -> Result<Option<Drain>, String>
Attempt to produce a Drain out of Output config description
Returns:
Ok(Box<Drain>)if succesfully built aDrainOk(None)if output type does not matchErr(String)on error
Implementors
impl DrainFactory for FileDrainFactoryimpl DrainFactory for TermDrainFactory