Skip to content

Commit

Permalink
[crater] Use logging for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyr committed Sep 17, 2024
1 parent 218f877 commit 177bee8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion fontc_crater/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
[dependencies]
fontc = { version = "0.0.1", path = "../fontc" }

google-fonts-sources = "0.3.0"
google-fonts-sources = "0.3.1"
maud = "0.26.0"

chrono.workspace = true
Expand All @@ -23,4 +23,5 @@ serde_yaml.workspace = true
serde_json.workspace = true
tempfile.workspace = true
env_logger.workspace = true
log.workspace = true

4 changes: 2 additions & 2 deletions fontc_crater/src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn run_crater_and_save_results(args: &CiArgs) -> Result<(), Error> {
{
// eventually we will want an argument to force rerunning, which we'll
// use when we update fontmake or the input data set
eprintln!("fontc rev is unchange from last run, skipping");
log::info!("fontc rev is unchange from last run, skipping");
return Ok(());
}

Expand All @@ -109,7 +109,7 @@ fn run_crater_and_save_results(args: &CiArgs) -> Result<(), Error> {
.as_ref()
.map(Path::new)
.unwrap_or(temp_dir.path());
eprintln!("using working dir {}", cache_dir.display());
log::info!("using working dir {}", cache_dir.display());

let began = Utc::now();
let results = super::run_all(&inputs, cache_dir, super::ttx_diff_runner::run_ttx_diff)?;
Expand Down
4 changes: 2 additions & 2 deletions fontc_crater/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ fn run_all<T: Send, E: Send>(
.map(|target| {
let i = counter.fetch_add(1, Ordering::Relaxed) + 1;
currently_running.fetch_add(1, Ordering::Relaxed);
eprintln!("starting {} ({i}/{total_targets})", target.display());
log::debug!("starting {} ({i}/{total_targets})", target.display());
let r = runner(&target);
let n_running = currently_running.fetch_sub(1, Ordering::Relaxed);
eprintln!("finished {} ({n_running} active)", target.display());
log::debug!("finished {} ({n_running} active)", target.display());
let target = target
.strip_prefix(cache_dir)
.unwrap_or(target.as_path())
Expand Down
2 changes: 1 addition & 1 deletion fontc_crater/src/ttx_diff_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(super) fn run_ttx_diff(source: &Path) -> RunResult<DiffOutput, DiffError> {
Some(2) => match serde_json::from_slice::<RawDiffOutput>(&output.stdout) {
Err(_) => {
let output = String::from_utf8_lossy(&output.stdout);
eprintln!("MALFORMED JSON? '{output}'");
log::error!("MALFORMED JSON? '{output}'");
std::process::exit(1);
}
Ok(RawDiffOutput::Success(success)) => {
Expand Down

0 comments on commit 177bee8

Please sign in to comment.