1
0
Fork 0
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:
J2P 2018-09-03 00:04:44 +09:00 committed by Ryan Dahl
parent 77faad8070
commit f949ded933

View file

@ -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| {