Initialise logger earlier
This commit is contained in:
parent
46bbee19f7
commit
37459b8df3
1 changed files with 8 additions and 8 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -313,6 +313,14 @@ fn collect_files(
|
||||||
fn parse_opts_into_struct(
|
fn parse_opts_into_struct(
|
||||||
matches: &ArgMatches,
|
matches: &ArgMatches,
|
||||||
) -> Result<(OutFile, Option<PathBuf>, Options), String> {
|
) -> Result<(OutFile, Option<PathBuf>, Options), String> {
|
||||||
|
stderrlog::new()
|
||||||
|
.module(module_path!())
|
||||||
|
.quiet(matches.is_present("quiet"))
|
||||||
|
.verbosity(if matches.is_present("verbose") { 3 } else { 2 })
|
||||||
|
.show_level(false)
|
||||||
|
.init()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
let mut opts = if let Some(x) = matches.value_of("optimization") {
|
let mut opts = if let Some(x) = matches.value_of("optimization") {
|
||||||
if let Ok(opt) = x.parse::<u8>() {
|
if let Ok(opt) = x.parse::<u8>() {
|
||||||
Options::from_preset(opt)
|
Options::from_preset(opt)
|
||||||
|
|
@ -397,14 +405,6 @@ fn parse_opts_into_struct(
|
||||||
opts.preserve_attrs = true;
|
opts.preserve_attrs = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
stderrlog::new()
|
|
||||||
.module(module_path!())
|
|
||||||
.quiet(matches.is_present("quiet"))
|
|
||||||
.verbosity(if matches.is_present("verbose") { 3 } else { 2 })
|
|
||||||
.show_level(false)
|
|
||||||
.init()
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
if matches.is_present("no-bit-reduction") {
|
if matches.is_present("no-bit-reduction") {
|
||||||
opts.bit_depth_reduction = false;
|
opts.bit_depth_reduction = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue