Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace fmt.Printf calls with warning logs #1305

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wwared
Copy link

@wwared wwared commented Oct 25, 2024

Description

As far as I can tell, there's only two places (outside of tests) that still are using fmt.Printf/fmt.Println to print warnings to stdout, in the frontend/schema directory. This small PR replaces them with warning logs using the logger module.

If the severity of the message should be different from a warning, let me know so I can change it quickly.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

I've tested this locally against a test case that triggers this message (specifically https://github.com/argumentcomputer/sphinx doing a Plonk BN254 proof verification, via an FFI wrapper at https://github.com/argumentcomputer/lurk-hs), and with this patch the messages are now logged at the proper level, as follows:

Before:

Testing fixture: "/home/w/dev/w/lurk-hs/assets/epoch_change.json"
ignoring uninitialized slice: Vars []frontend.Variable
ignoring uninitialized slice: Vars []frontend.Variable
ignoring uninitialized slice: Vars []frontend.Variable
Test completed for fixture: "/home/w/dev/w/lurk-hs/assets/epoch_change.json"

After:

Testing fixture: "/home/w/dev/w/lurk-hs/assets/epoch_change.json"
17:15:32 WRN ignoring uninitialized slice slice name=Vars slice type=[]frontend.Variable
17:15:32 WRN ignoring uninitialized slice slice name=Vars slice type=[]frontend.Variable
17:15:32 WRN ignoring uninitialized slice slice name=Vars slice type=[]frontend.Variable
Test completed for fixture: "/home/w/dev/w/lurk-hs/assets/epoch_change.json"

How has this been benchmarked?

This change is minor and has not been benchmarked.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@CLAassistant
Copy link

CLAassistant commented Oct 25, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants