Skip to content

Commit

Permalink
Merge pull request #6 from nanianlisao/chore_hide_error
Browse files Browse the repository at this point in the history
chore: support ERROR_LOG to not eprintln error
  • Loading branch information
ityuany authored Dec 12, 2024
2 parents 2296763 + 640d055 commit 9a19322
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions crates/module_graph/src/graph.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{
collections::{HashMap, HashSet},
env,
path::Path,
sync::{
atomic::{AtomicU32, Ordering},
Expand Down Expand Up @@ -181,11 +182,15 @@ impl<'a> Graph<'a> {
{
Ok(rp) => rp,
Err(_) => {
eprintln!(
"resolve error: {} {}",
source_value,
path.to_string_lossy()
);
let error_log =
env::var("ERROR_LOG").unwrap_or_else(|_| "1".to_string());
if error_log == "1" {
eprintln!(
"resolve error: {} {}",
source_value,
path.to_string_lossy()
);
}
continue;
}
};
Expand Down

0 comments on commit 9a19322

Please sign in to comment.