Skip to content

refactor!: contract logging plumbing cleanup#20282

Merged
benesjan merged 1 commit intonextfrom
02-09-refactor_contract_logging_plumbing_cleanup
Feb 11, 2026
Merged

refactor!: contract logging plumbing cleanup#20282
benesjan merged 1 commit intonextfrom
02-09-refactor_contract_logging_plumbing_cleanup

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Feb 9, 2026

The debug_log naming became problematic as different log levels are supported and hence the name collides with the debug log level even though it's a generic util.

For this reason I've renamed debug_log simply as log and I've cleaned up what used to be debug_log.nr file (in this PR renamed to logging.nr). The cleanup consists of:

  • dropping the log_slice functions (use of slices is now discouraged),
  • introducing individual functions for different log levels,
  • un-exposing the log level constants (the specific functions should be used instead)

This is a breaking change as the imports need to get updated.

This PR is a followup of #19960

Copy link
Contributor Author

benesjan commented Feb 9, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@benesjan benesjan force-pushed the 02-09-refactor_contract_logging_plumbing_cleanup branch 2 times, most recently from f5b3b8a to b0b3c1c Compare February 9, 2026 15:06
@AztecBot AztecBot force-pushed the 01-27-feat_separate_contract_log_channel branch from 47f99c2 to 166c4d6 Compare February 9, 2026 15:58
Base automatically changed from 01-27-feat_separate_contract_log_channel to next February 9, 2026 18:20
@benesjan benesjan changed the base branch from next to graphite-base/20282 February 10, 2026 06:24
@benesjan benesjan force-pushed the 02-09-refactor_contract_logging_plumbing_cleanup branch from b0b3c1c to 4bf1c81 Compare February 10, 2026 06:24
@benesjan benesjan changed the base branch from graphite-base/20282 to 02-10-fix_post-noir-sync_cleanup February 10, 2026 06:24
Base automatically changed from 02-10-fix_post-noir-sync_cleanup to next February 10, 2026 07:23
@benesjan benesjan force-pushed the 02-09-refactor_contract_logging_plumbing_cleanup branch from ce99975 to 4c010c7 Compare February 10, 2026 08:59
@benesjan benesjan marked this pull request as ready for review February 10, 2026 08:59
@benesjan benesjan changed the title refactor: contract logging plumbing cleanup refactor!: contract logging plumbing cleanup Feb 10, 2026
@benesjan benesjan added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Feb 10, 2026
@AztecBot
Copy link
Collaborator

⚠️ Docs Examples Validation Failed

Compile (Noir contracts)

(truncated)...
ile contracts/recursive_verification_contract examples
contracts/counter_contract	Cache download of contract-8acd9bcfee67419a.tar.gz failed.
contracts/bob_token_contract	Cache download of contract-6fffccf06cb4465e.tar.gz failed.
contracts/nft_bridge	Cache download of contract-0d61a5f357a574ef.tar.gz failed.
contracts/nft	Cache download of contract-b223e141d11e070f.tar.gz failed.
contracts/recursive_verification_contract	Cache download of contract-a3e9377b2c3add62.tar.gz failed.
contracts/nft	error: `dep::aztec` path is deprecated
contracts/nft	  ┌─ examples/contracts/nft/src/nft.nr:2:5
contracts/nft	  │
contracts/nft	2 │ use dep::aztec::{macros::notes::note, protocol::traits::Packable};
contracts/nft	  │     --- Please use `::aztec` instead
contracts/nft	  │
contracts/nft	
contracts/nft	error: `dep::aztec` path is deprecated
contracts/nft	  ┌─ examples/contracts/nft/src/main.nr:8:9
contracts/nft	  │
contracts/nft	8 │     use dep::aztec::{
contracts/nft	  │         --- Please use `::aztec` instead
contracts/nft	  │
contracts/nft	
contracts/nft	error: `dep::aztec` path is deprecated
contracts/nft	   ┌─ examples/contracts/nft/src/main.nr:13:9
contracts/nft	   │
contracts/nft	13 │     use dep::aztec::messages::message_delivery::MessageDelivery;
contracts/nft	   │         --- Please use `::aztec` instead
contracts/nft	   │
contracts/nft	
contracts/nft_bridge	error: `dep::aztec` path is deprecated
contracts/nft_bridge	  ┌─ examples/contracts/nft_bridge/src/main.nr:6:9
contracts/nft_bridge	  │
contracts/nft_bridge	6 │     use dep::aztec::{
contracts/nft_bridge	  │         --- Please use `::aztec` instead
contracts/nft_bridge	  │
contracts/nft_bridge	
contracts/nft_bridge	error: `dep::NFTPunk` path is deprecated
contracts/nft_bridge	   ┌─ examples/contracts/nft_bridge/src/main.nr:11:9
contracts/nft_bridge	   │
contracts/nft_bridge	11 │     use dep::NFTPunk::NFTPunk;
contracts/nft_bridge	   │         --- Please use `::NFTPunk` instead
contracts/nft_bridge	   │
contracts/nft_bridge	
contracts/nft	Aborting due to 3 previous errors
parallel: This job failed:
compile contracts/nft examples
Seq	Host	Starttime	JobRuntime	Send	Receive	Exitval	Signal	Command
3	:	1770717230.387	     1.777	0	738	1	0	compile contracts/nft examples

TypeScript validation

(truncated)...
ing linked packages...
aztecjs_getting_started	✓ @aztec/aztec.js: 77 .d.ts files
aztecjs_advanced	✓ @aztec/ethereum: 85 .d.ts files
aztecjs_authwit	✓ @aztec/aztec.js: 77 .d.ts files
aztecjs_getting_started	✓ @aztec/accounts: 27 .d.ts files
aztecjs_authwit	✓ @aztec/accounts: 27 .d.ts files
aztecjs_advanced	✓ @aztec/stdlib: 477 .d.ts files
aztecjs_getting_started	✓ @aztec/test-wallet: 8 .d.ts files
aztecjs_authwit	✓ @aztec/test-wallet: 8 .d.ts files
aztecjs_getting_started	✓ @aztec/noir-contracts.js: 33 .d.ts files
aztecjs_authwit	✓ @aztec/noir-contracts.js: 33 .d.ts files
aztecjs_connection	Type checking 'aztecjs_connection'...
aztecjs_advanced	Type checking 'aztecjs_advanced'...
aztecjs_authwit	Type checking 'aztecjs_authwit'...
aztecjs_getting_started	Type checking 'aztecjs_getting_started'...
aztecjs_connection	✓ 'aztecjs_connection' validated successfully
aztecjs_connection	Cleaning up temporary files for 'aztecjs_connection'...
aztecjs_testing	validate_project aztecjs_testing
aztecjs_testing	�[38;2;188;109;208m---�[0m �[38;2;95;167;241m�[1mValidating aztecjs_testing�[0m �[38;2;188;109;208m---�[0m
aztecjs_testing	No custom contracts for 'aztecjs_testing', skipping codegen...
aztecjs_testing	Setting up yarn for 'aztecjs_testing'...
aztecjs_advanced	✓ 'aztecjs_advanced' validated successfully
aztecjs_advanced	Cleaning up temporary files for 'aztecjs_advanced'...
bob_token_contract	validate_project bob_token_contract
aztecjs_authwit	✓ 'aztecjs_authwit' validated successfully
aztecjs_authwit	Cleaning up temporary files for 'aztecjs_authwit'...
recursive_verification	validate_project recursive_verification
bob_token_contract	ERROR: Artifact not found for 'bob_token_contract': /home/aztec-dev/aztec-packages/docs/target/bob_token_contract-BobToken.json
parallel: This job failed:
validate_project bob_token_contract
Seq	Host	Starttime	JobRuntime	Send	Receive	Exitval	Signal	Command
3	:	1770717234.746	     4.875	0	1999	0	0	validate_project aztecjs_connection
1	:	1770717234.740	     5.023	0	2091	0	0	validate_project aztecjs_advanced
2	:	1770717234.743	     5.035	0	1867	0	0	validate_project aztecjs_authwit
6	:	1770717239.768	     0.053	0	164	1	0	validate_project bob_token_contract
ERROR: Some project(s) failed validation

Action required: Please fix the docs examples or update them to match the current API.

cc @AztecProtocol/devrel

"avmOpcodeStorageRead" => handle_storage_read(avm_instrs, destinations, inputs),
"avmOpcodeStorageWrite" => handle_storage_write(avm_instrs, destinations, inputs),
"utilityDebugLog" => handle_debug_log(avm_instrs, destinations, inputs),
"utilityLog" => handle_debug_log(avm_instrs, destinations, inputs),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked with Alvaro in DMs and he said that stopping in the transpiler when it comes to the public domain is the way to go.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a general concern with this PR, I'm a bit worried about the potential confusion between "aztec logs" and logging infrastructure. Do you think maybe using logging as much as possible for the latter case would help disambiguate?

In the case of this particular change this would mean utilityLog => utilityLogging (I guess I'm seeing why it was called utilityDebugLog in the first place...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind my comment, after going through the whole PR I think it's all quite clear now

Copy link
Contributor Author

@benesjan benesjan Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried about the potential confusion between "aztec logs" and logging infrastructure.

I share your concern but don't like utilityLogging as it doesn't communicate and action and I failed to come up with a better naming 😏

@benesjan benesjan force-pushed the 02-09-refactor_contract_logging_plumbing_cleanup branch from d9c11ca to 55e3058 Compare February 11, 2026 11:05
@benesjan benesjan enabled auto-merge February 11, 2026 11:05
@AztecBot AztecBot force-pushed the 02-09-refactor_contract_logging_plumbing_cleanup branch from 55e3058 to 25002e4 Compare February 11, 2026 11:49
The `debug_log` naming became problematic as different log levels are supported and hence the name collides with the debug log level even though it's a generic util.

For this reason I've renamed `debug_log` simply as `log` and I've cleaned up what used to be `debug_log.nr` file (in this PR renamed to `logging.nr`). The cleanup consists of:
- dropping the log_slice functions (use of slices is now discouraged),
- introducing individual functions for different log levels,
- un-exposing the log level constants (the specific functions should be used instead)

This is a breaking change as the imports need to get updated.

This PR is a followup of #19960
@AztecBot AztecBot force-pushed the 02-09-refactor_contract_logging_plumbing_cleanup branch from 25002e4 to 3fcb658 Compare February 11, 2026 11:51
@benesjan benesjan added this pull request to the merge queue Feb 11, 2026
Merged via the queue into next with commit 71d202c Feb 11, 2026
20 checks passed
@benesjan benesjan deleted the 02-09-refactor_contract_logging_plumbing_cleanup branch February 11, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants