Skip to content

Commit

Permalink
chore: replace env-logger with tracing (#3878)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

While env-logger concerns itself with logging, tracing is drop in
replacement to support logging case but also provides more features for
profiling.

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Tom French <tom@tomfren.ch>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 20, 2023
1 parent 194939c commit b594919
Show file tree
Hide file tree
Showing 26 changed files with 128 additions and 151 deletions.
120 changes: 52 additions & 68 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ const_format = "0.2.30"
num-bigint = "0.4"
num-traits = "0.2"
similar-asserts = "1.5.0"
log = "0.4.17"
tempfile = "3.6.0"

tracing = "0.1.40"
tracing-web = "0.1.3"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

[profile.dev]
# This is required to be able to run `cargo test` in acvm_js due to the `locals exceeds maximum` error.
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repository.workspace = true
num-bigint.workspace = true
num-traits.workspace = true
thiserror.workspace = true
log.workspace = true
tracing.workspace = true

acir.workspace = true
brillig_vm.workspace = true
Expand Down
5 changes: 1 addition & 4 deletions acvm-repo/acvm/src/compiler/optimizers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ pub fn optimize(acir: Circuit) -> (Circuit, AcirTransformationMap) {
}

/// Applies [`ProofSystemCompiler`][crate::ProofSystemCompiler] independent optimizations to a [`Circuit`].
#[tracing::instrument(level = "trace", name = "optimize_acir" skip(acir))]
pub(super) fn optimize_internal(acir: Circuit) -> (Circuit, Vec<usize>) {
log::trace!("Start circuit optimization");

// General optimizer pass
let opcodes: Vec<Opcode> = acir
.opcodes
Expand Down Expand Up @@ -54,7 +53,5 @@ pub(super) fn optimize_internal(acir: Circuit) -> (Circuit, Vec<usize>) {
let (acir, acir_opcode_positions) =
range_optimizer.replace_redundant_ranges(acir_opcode_positions);

log::trace!("Finish circuit optimization");

(acir, acir_opcode_positions)
}

0 comments on commit b594919

Please sign in to comment.