Function alog::run

source ·
pub fn run(config: &Config<'_>, ioconfig: &IOConfig<'_>) -> Result<(), IOError>
Expand description

Creates a reader (defaults to std::io::Stdin) and writer (defaults to std::io::Stdout) from alog::IOConfig and uses both along with alog::Config to actually replace any first word in reader with strings stored in alog::Config.

Appends data if the writer points to an existing, writeable file.

Errors

Returns an error if the new reader / writer retruns an error.

Example

fn main() {
    alog::run(
        &alog::Config {
            host: "XXX",
            ..Default::default()
        },
        &alog::IOConfig::default()
    ).unwrap();
}