mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -05:00
Log level code refactoring
This commit is contained in:
parent
77faad8070
commit
f949ded933
1 changed files with 6 additions and 5 deletions
11
src/main.rs
11
src/main.rs
|
@ -131,6 +131,7 @@ fn main() {
|
||||||
let js_args = flags::v8_set_flags(env::args().collect());
|
let js_args = flags::v8_set_flags(env::args().collect());
|
||||||
|
|
||||||
let mut d = Deno::new(js_args);
|
let mut d = Deno::new(js_args);
|
||||||
|
let mut log_level = log::LevelFilter::Info;
|
||||||
|
|
||||||
if d.flags.help {
|
if d.flags.help {
|
||||||
flags::print_usage();
|
flags::print_usage();
|
||||||
|
@ -142,11 +143,11 @@ fn main() {
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
log::set_max_level(if d.flags.log_debug {
|
if d.flags.log_debug {
|
||||||
log::LevelFilter::Debug
|
log_level = log::LevelFilter::Debug;
|
||||||
} else {
|
}
|
||||||
log::LevelFilter::Info
|
|
||||||
});
|
log::set_max_level(log_level);
|
||||||
|
|
||||||
d.execute("deno_main.js", "denoMain();")
|
d.execute("deno_main.js", "denoMain();")
|
||||||
.unwrap_or_else(|err| {
|
.unwrap_or_else(|err| {
|
||||||
|
|
Loading…
Reference in a new issue