Repository navigation
Convert remaining println!/eprintln! in examples and benches to arlog_*! #90
Description
Activity
- addedgood first issueGood for newcomersGood for newcomers
on Apr 25, 2026 Hi @kalwalt
I'd like to take this on if it's still up for grabs. I'll follow the suggested four-PR breakdown and use
simple.rsfrom #85 as the template. Planning to start with PR 1 (the small examples + the bench) so you can sanity-check the pattern before I move on to the bigger files.Will branch off latest
devand runcargo fmt --all -- --check,cargo clippy --all-targets --all-features, andcargo build --all-featuresbefore opening each PR. Let me know if anything in the plan should change.Hi @kalwalt
I'd like to take this on if it's still up for grabs. I'll follow the suggested four-PR breakdown and use
simple.rsfrom #85 as the template. Planning to start with PR 1 (the small examples + the bench) so you can sanity-check the pattern before I move on to the bigger files.Will branch off latest
devand runcargo fmt --all -- --check,cargo clippy --all-targets --all-features, andcargo build --all-featuresbefore opening each PR. Let me know if anything in the plan should change.@maxwelljhuang you are welcome! Start with the PR 1 starting from
devbranch and againstdevyou can also read our CONTRIBUTING.md explaining how to contribute to the project. 😊Quick scope question on feature_map_bench.rs before I include it in PR 1: the eprintln! for the missing-asset skip can be converted to arlog_w!, but without an initialized logger the bench produces no output for that case (regression vs current behavior). Three options I see:
- Convert + add ar_log_init_default() and required-features = ["log-helpers"] to the bench (visibility preserved, slightly wider PR scope).
- Leave the eprintln! as bench scaffolding and exclude it from PR 1.
- Convert silently and address visibility in a follow-up.
I'm not sure which option is best right now
@maxwelljhuang go for option 1: add the
ar_log_init_default()inside thebench_ar2_gen_feature_mapfunction and converteprintln!toarlog_e!, add therequired-features = ["log-helpers"]in Cargo.toml and you will be fine. If you have other doubt i will help you during the PR.- added a commit that references this issue
on Apr 29, 2026 @maxwelljhuang would you continue on this? I will appreciate it. 😊
Hi @kalwalt , apologies for the delay, I've been a little busy with moving but I'll get right back on it!
Reacted by Walter Perdan- added a commit that references this issue
on May 6, 2026 - added a commit that references this issue
on May 7, 2026 - added a commit that references this issue
on May 13, 2026 @maxwelljhuang if you have the time and when you have time you can continue on this, It will be a pleasure if you complete the issue. 🙂
Completed with PR #164
- moved this from In progress to Done in Plan to port KPM to rust
on May 28, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Summary
Convert all remaining
println!/eprintln!calls incrates/core/examples/andcrates/core/benches/to thearlog_*!macros, per the project convention inCLAUDE.md§2 ("Logging — use thearlogsystem"). PR #85 already migratedsimple.rsas the canonical model; finish the job across the rest.Environment
CLAUDE.md§2 —arlog_d!/arlog_i!/arlog_w!/arlog_e!simple.rsexample)Reproduction Steps
rg -c 'println!|eprintln!' crates/core/examples/ crates/core/benches/Actual State (audit at HEAD of
dev)Examples — 152 total occurrences across 6 files:
println!/eprintln!countcrates/core/examples/barcode.rscrates/core/examples/debug_labeling.rscrates/core/examples/generate_patt.rscrates/core/examples/load_nft.rsarlog_i!+println!— incomplete)crates/core/examples/nft_marker_gen.rscrates/core/examples/simple_nft.rsBenches — 1 occurrence:
crates/core/benches/feature_map_bench.rseprintln!for missing-asset skip)Already converted (reference, not in scope):
crates/core/examples/simple.rs— done in PR Fix simple.rs pattern matching (CF=-1) by setting MONO pixel format #85.Expected Behavior
Each file follows the
simple.rspattern:println!("...")witharlog_i!("...")for informational output,arlog_e!for errors,arlog_d!for verbose/per-frame.env_logger::init()(where present) withwebarkitlib_rs::arlog::ar_log_init_default().use webarkitlib_rs::{arlog_e, arlog_i};(orarlog_d/arlog_was needed).required-features = ["log-helpers"]to the example's[[example]]block incrates/core/Cargo.tomlif not already declared (socargo run --example <name>works without a feature flag inside CI)..github/workflows/ci.ymlif any of the converted examples are run there (currently onlysimpleis invoked).Visual Evidence
PR #85 diffs are the canonical model:
crates/core/examples/simple.rs— full conversioncrates/core/Cargo.toml—required-features = ["log-helpers"]forsimple.github/workflows/ci.yml—--features log-helperson thecargo run --example simplelinesImpact
Low (quality / consistency only) — does not change runtime behavior of the library. Aligns examples and benches with the convention library code already follows. Keeps newcomers from copying stale
println!patterns into new code.Suggested Approach (one PR per group recommended, NOT one giant PR)
To keep diffs reviewable:
barcode.rs(11) +debug_labeling.rs(4) + the benchfeature_map_bench.rs(1). Easy warm-up.load_nft.rsfinish-up (22 remaining). The "canonical" example per CLAUDE.md still mixesprintln!witharlog_i!; finish converting it so it's actually canonical.generate_patt.rs(34) +nft_marker_gen.rs(49). Heavier output volume; review separately.simple_nft.rs(32). Depends onffi-backendfeature — keep separate so reviewers with non-FFI setups can sign off on the others first.Each PR:
dev, fresh per group.CHANGELOG.md.required-features = ["log-helpers"]for any example that doesn't have it yet.cargo fmt --all -- --check,cargo clippy --all-targets --all-features,cargo build --all-featuresclean.Additional Context
crates/core/src/arlog.rs(rustdoc header refresh from the documentation skill, see feat: Port ARToolKit logging system (arLog / arLogv) to Rust — with efficiency analysis #57).feature_map_bench.rseprintln!→ consider whether benches (which run under criterion) should usearlog_*!at all, or ifeprintln!is acceptable in#[cfg(test)]-style scaffolding. Discussion welcome on the issue.Labels suggested:
chore,area:examples,area:benches,good-first-issue.Priority: Low.