You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convert all remaining println! / eprintln! calls in crates/core/examples/ and crates/core/benches/ to the arlog_*! macros, per the project convention in CLAUDE.md §2 ("Logging — use the arlog system"). PR #85 already migrated simple.rs as the canonical model; finish the job across the rest.
Replace println!("...") with arlog_i!("...") for informational output, arlog_e! for errors, arlog_d! for verbose/per-frame.
Replace env_logger::init() (where present) with webarkitlib_rs::arlog::ar_log_init_default().
Add use webarkitlib_rs::{arlog_e, arlog_i}; (or arlog_d / arlog_w as needed).
Add required-features = ["log-helpers"] to the example's [[example]] block in crates/core/Cargo.toml if not already declared (so cargo run --example <name> works without a feature flag inside CI).
Update .github/workflows/ci.yml if any of the converted examples are run there (currently only simple is invoked).
crates/core/Cargo.toml — required-features = ["log-helpers"] for simple
.github/workflows/ci.yml — --features log-helpers on the cargo run --example simple lines
Impact
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:
PR 1 — small examples: barcode.rs (11) + debug_labeling.rs (4) + the bench feature_map_bench.rs (1). Easy warm-up.
PR 2 — load_nft.rs finish-up (22 remaining). The "canonical" example per CLAUDE.md still mixes println! with arlog_i!; finish converting it so it's actually canonical.
For the feature_map_bench.rseprintln! → consider whether benches (which run under criterion) should use arlog_*! at all, or if eprintln! is acceptable in #[cfg(test)]-style scaffolding. Discussion welcome on the issue.
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.