diff --git a/polyglot/piranha/src/main.rs b/polyglot/piranha/src/main.rs index b3ed2f9032..a42d1c4616 100644 --- a/polyglot/piranha/src/main.rs +++ b/polyglot/piranha/src/main.rs @@ -17,12 +17,12 @@ use std::{fs, time::Instant}; use log::info; use polyglot_piranha::{ execute_piranha, models::piranha_arguments::PiranhaArguments, - models::piranha_output::PiranhaOutputSummary, utilities::initialize_logger, + models::piranha_output::PiranhaOutputSummary, }; fn main() { let now = Instant::now(); - initialize_logger(false); + env_logger::init(); let args = PiranhaArguments::from_command_line(); diff --git a/polyglot/piranha/src/tests/mod.rs b/polyglot/piranha/src/tests/mod.rs index a1344ad6a6..a7f822d424 100644 --- a/polyglot/piranha/src/tests/mod.rs +++ b/polyglot/piranha/src/tests/mod.rs @@ -19,7 +19,7 @@ use crate::config::CommandLineArguments; use crate::execute_piranha; use crate::models::piranha_arguments::PiranhaArguments; use crate::models::piranha_output::PiranhaOutputSummary; -use crate::utilities::{eq_without_whitespace, find_file, initialize_logger, read_file}; +use crate::utilities::{eq_without_whitespace, find_file, read_file}; mod test_piranha_java; mod test_piranha_kt; @@ -34,7 +34,7 @@ static INIT: Once = Once::new(); fn initialize() { INIT.call_once(|| { - initialize_logger(true); + env_logger::init(); }); } diff --git a/polyglot/piranha/src/utilities/mod.rs b/polyglot/piranha/src/utilities/mod.rs index f32afe1116..a2ebf2fbc6 100644 --- a/polyglot/piranha/src/utilities/mod.rs +++ b/polyglot/piranha/src/utilities/mod.rs @@ -12,15 +12,13 @@ Copyright (c) 2022 Uber Technologies, Inc. */ pub(crate) mod tree_sitter_utilities; - use std::collections::HashMap; #[cfg(test)] use std::fs::{self, DirEntry}; -use std::fs::{File, OpenOptions}; +use std::fs::File; use std::hash::Hash; use std::io::{BufReader, Read}; use std::path::PathBuf; -use env_logger::{Env, Builder}; // Reads a file. pub(crate) fn read_file(file_path: &PathBuf) -> Result { @@ -66,15 +64,6 @@ impl MapOfVec for HashMap> { } } -/// Initialize logger. -pub fn initialize_logger(is_test: bool) { - Builder::default() - .format_timestamp(None) - .is_test(is_test) - .default_format() - .init(); -} - /// Compares two strings, ignoring whitespace pub(crate) fn eq_without_whitespace(s1: &str, s2: &str) -> bool { s1.split_whitespace()