snarkify / sirius

A Plonkish folding framework for Incrementally Verifiable Computation (IVC).
MIT License
119 stars 17 forks source link

feat: migrate to tracing #198

Closed cyphersnake closed 6 months ago

cyphersnake commented 6 months ago

Motivation This crate supports spans. That is, you can add a context to the logs that will be respected in a certain interval.

https://docs.rs/tracing/latest/tracing/span/index.html

The alternative old & well-tested solution slog itself recommends the use of tracing

Overview

cyphersnake commented 6 months ago

With tracing, the #197 will be easy to rebuild without runtime flags

drouyang commented 6 months ago

This is new to me, maybe @chaosma as well. Could you share some example output or some blog post?

cyphersnake commented 6 months ago

This is new to me, maybe @chaosma as well. Could you share some example output or some blog post?

Well specifically here it's just a migration to a different logging crate, fully compatible with log, but with new features. We are not very interested in async support, but they have scope (I put a link to the doc in the PR body) and this feature is very convenient for tracking complex contexts.

README

As a matter of fact, 'slog' used to be a replacement for 'log' if you needed some extra features, now 'tracing' is becoming such a framework

drouyang commented 6 months ago

I'm okay with using tracing as a logging framework. My question was more about how and when to use the spans.

cyphersnake commented 6 months ago

I'm okay with using tracing as a logging framework. My question was more about how and when to use the spans.

We have for example primary & secondary circuit starts inside IVC are identical (except for the input) and we have to look for the point "where logs of this case start" etc.

I've been wanting to introduce them for a long time, but I've been putting it off. But considering Chao's request "sometimes track a certain function", this is solved through scope, since you can track callstack.

drouyang commented 6 months ago

I like debug facilities and logs. Logs are as helpful as comments, especially during debugging and instrumentation for optimization. They help developers learn about the internals of a piece of code.

I will let @chaosma approve this and see if the scope feature could address his request.