Struct fern::OutputConfig
[−]
[src]
pub struct OutputConfig<'a>(_);
This config struct contains various output options to send messages to.
You can use this in conjunction with DispatchConfig for message formating and filtering, or alone if you don't need to filter or format messages.
Methods
impl<'a> OutputConfig<'a>
[src]
fn child(config: DispatchConfig<'a>) -> OutputConfig<'a>
Returns a child logger that sends messages to another DispatchConfig.
fn file<P: ?Sized + AsRef<Path>>(path: &'a P) -> OutputConfig<'a>
Returns a file logger. All messages sent to this will be outputted to the specified path.
Note that the file will be opened with write(true), append(true) and create(true). If you
need to open with other options, use OutputConfig::file_with_options()
fn file_with_options<P: ?Sized>(path: &'a P, options: &'a OpenOptions) -> OutputConfig<'a> where P: AsRef<Path>
Returns a file logger with OpenOptions. All messages will be sent to the specified file. The file will be opened using the specified OpenOptions.
fn stdout() -> OutputConfig<'static>
Returns an stdout logger. All messages sent to this will be printed to stdout.
fn stderr() -> OutputConfig<'static>
Returns an stderr logger. All messages sent to this will be printed to stderr.
fn null() -> OutputConfig<'static>
Returns a null logger. All messages sent to this logger will disappear into the void.
fn custom(log: Box<Logger>) -> OutputConfig<'static>
Custom implementation logger. All messages sent to this logger will be passed on to your custom logger.
Trait Implementations
impl<'a> IntoLog for OutputConfig<'a>
[src]
fn into_fern_logger(self) -> Result<Box<Logger>>
Builds this configuration into a fern::Logger
that you can send messages to. This method can be used to generate a logger you can call manually, and catch any errors from. You probably want to use fern::init_global_logger()
instead of calling this directly. Read more
fn into_log(self) -> Result<Box<Log>>
Builds this configuration into a log::Log
that you can send messages to. This will open any files, get handles to stdout/stderr, etc. depending on which type of logger this is. Read more