Commit 142bbfd
feat: Implement custom logging initialization for SP1 package (#193)
* feat: Implement custom logging initialization for SP1 package
Configures logging for go through an environment variable.
Example usage:
```
SP1_GO_LOG=false cargo test
./cargo test
SP1_GO_LOG=true ./cargo test
```
This solution works because:
- The init() function in logging.go will run before any other code in the package
- Since gnark uses zerolog, setting the global log level will affect all logging throughout the application, including in dependencies
- The change is minimal and contained to just one file
- It doesn't require any changes to the Rust code or to gnark's source code
- It's configurable through an environment variable
* Update recursion/gnark-ffi/go/sp1/logging.go
Adds an 'off' option
Co-authored-by: wwared <[email protected]>
---------
Co-authored-by: wwared <[email protected]>1 parent 1650846 commit 142bbfd
1 file changed
+37
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments