Modify Logger constructor.

This commit is contained in:
jcamiel 2024-03-15 10:48:46 +01:00
parent f46f469f8b
commit 2cac54911e
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
2 changed files with 8 additions and 16 deletions

View File

@ -87,17 +87,15 @@ pub fn run(
// We also create a common logger for this run (logger verbosity can eventually be mutated on
// each entry) .
let color = logger_options.color;
let error_format = logger_options.error_format;
let filename = &logger_options.filename;
let verbosity = logger_options.verbosity;
let mut logger = Logger::new(color, error_format, filename, verbosity, stderr);
let mut logger = Logger::new(logger_options, stderr);
// Create a progress bar for the sequential run, progress will be report in the main thread,
// as soon as an entry is executed.
let filename = &logger_options.filename;
let current_file = logger_options.current_file;
let total_files = logger_options.total_files;
let test = logger_options.test;
let color = logger_options.color;
let progress_bar = logger_options.progress_bar;
let progress = SeqProgress::new(
filename,

View File

@ -217,18 +217,12 @@ impl Default for LoggerOptionsBuilder {
impl Logger {
/// Creates a new instance.
pub fn new(
color: bool,
error_format: ErrorFormat,
filename: &str,
verbosity: Option<Verbosity>,
term: Stderr,
) -> Self {
pub fn new(options: &LoggerOptions, term: Stderr) -> Self {
Logger {
color,
error_format,
filename: filename.to_string(),
verbosity,
color: options.color,
error_format: options.error_format,
filename: options.filename.to_string(),
verbosity: options.verbosity,
stderr: term,
}
}