(log_filter_level: log::LevelFilter, formatter: F)
| 138 | } |
| 139 | |
| 140 | fn build_logger<F>(log_filter_level: log::LevelFilter, formatter: F) -> Result<(), anyhow::Error> |
| 141 | where |
| 142 | F: Fn(fern::FormatCallback, &std::fmt::Arguments, &log::Record) + Sync + Send + 'static, |
| 143 | { |
| 144 | fern::Dispatch::new() |
| 145 | .format(formatter) |
| 146 | .level(log_filter_level) |
| 147 | .chain(ProgressHandler::new(std::io::stdout()).into_output()) |
| 148 | .apply() |
| 149 | .map_err(|e| anyhow!("Unable to apply logger configuration ({:?})", e)) |
| 150 | } |
| 151 | |
| 152 | /// Prints program name, version etc. and command line arguments to log |
| 153 | pub(crate) fn log_program_info() { |
no test coverage detected