mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 23:59:59 -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 mut d = Deno::new(js_args);
|
||||
let mut log_level = log::LevelFilter::Info;
|
||||
|
||||
if d.flags.help {
|
||||
flags::print_usage();
|
||||
|
@ -142,11 +143,11 @@ fn main() {
|
|||
std::process::exit(0);
|
||||
}
|
||||
|
||||
log::set_max_level(if d.flags.log_debug {
|
||||
log::LevelFilter::Debug
|
||||
} else {
|
||||
log::LevelFilter::Info
|
||||
});
|
||||
if d.flags.log_debug {
|
||||
log_level = log::LevelFilter::Debug;
|
||||
}
|
||||
|
||||
log::set_max_level(log_level);
|
||||
|
||||
d.execute("deno_main.js", "denoMain();")
|
||||
.unwrap_or_else(|err| {
|
||||
|
|
Loading…
Reference in a new issue