Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Switch PWG to return a list of logs #95

Closed
vezenovm opened this issue Feb 14, 2023 · 1 comment
Closed

Switch PWG to return a list of logs #95

vezenovm opened this issue Feb 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@vezenovm
Copy link
Contributor

Problem

Currently Directive::Log exclusively works with println statements. We directly write the information inside of LogInfo to std output. This is not ideal as there are multiple ways that someone way want to access logging information in their Noir circuit (writing to file, log traces in memory, etc.).

The current design also requires us to pass down a flag during acir gen for determining whether to print logs during tests. More details can be found in this PR (noir-lang/noir#630).

Solution

Having Directive::Log collect logs into a vector that is returned from the PWG would be the ideal solution. This would then enable whomever is calling backend.solve to handle the logs as they see fit. Such as printing to std out, writing to file, or accessing a vector of logs in memory.

Alternatives considered

There are not many alternatives if we want to enable devs to access the PWG logs in memory. Also it is a superior design to have whomever is calling backend.solve decide how to handle the system logs (nargo, JS packages).

Additional context

Relevant feature requested in Noir that requires this change: noir-lang/noir#688

@vezenovm
Copy link
Contributor Author

vezenovm commented Jun 7, 2023

Closing this in favor of #348

@vezenovm vezenovm closed this as completed Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
1 participant