-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve logging problem #231
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,13 @@ Copyright (c) 2022 Uber Technologies, Inc. | |
|
||
use std::path::{Path, PathBuf}; | ||
|
||
use log::{error}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
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; | ||
|
@@ -32,7 +34,7 @@ static INIT: Once = Once::new(); | |
|
||
fn initialize() { | ||
INIT.call_once(|| { | ||
initialize_logger(true); | ||
env_logger::init(); | ||
}); | ||
} | ||
|
||
|
@@ -99,7 +101,7 @@ fn check_result(updated_files: Vec<PiranhaOutputSummary>, path_to_expected: Path | |
|
||
if !eq_without_whitespace(source_code_unit.content(), &expected_content) { | ||
all_files_match = false; | ||
println!("{}", &source_code_unit.content()); | ||
error!("{}", &source_code_unit.content()); | ||
} | ||
} | ||
assert!(all_files_match); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ use crate::{ | |
}; | ||
use colored::Colorize; | ||
use itertools::Itertools; | ||
use log::info; | ||
use log::{info}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Am I missing something about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No its equivalent. |
||
use std::collections::HashMap; | ||
#[cfg(test)] | ||
use tree_sitter::Parser; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed? I think
log::info
is the right syntax if we are just importing that, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YEs. Addressed by cargo format.
I think I ll add a new Github action that runs cargo format on each PR, as a commit. Idk