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

Tracing #19

Open
alecandido opened this issue Apr 18, 2024 · 0 comments
Open

Tracing #19

alecandido opened this issue Apr 18, 2024 · 0 comments

Comments

@alecandido
Copy link
Member

I'm very cautious about adding dependencies to qibo-core, to the point that at the moment there is none (but the standard library).

However, tracing is solving the problem of logging in a complete and flexible way.

https://github.com/tokio-rs/tracing

It would save us many debug prints, and reinventing the wheel.

It's still a further dependency, but the reason why I'm taking into account is that:

  • it supports no_std (not even needed at the moment)
  • but, more important, it can disappear at compile time:

    Trace verbosity levels can be statically disabled at compile time via Cargo features, similar to the log crate. Trace instrumentation at disabled levels will be skipped and will not even be present in the resulting binary unless the verbosity level is specified dynamically.
    https://docs.rs/tracing/latest/tracing/level_filters/index.html#compile-time-filters

Thus, the idea would be to fully disable it in production mode (if ever, we can decide specific compilation profiles for different applications).

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

No branches or pull requests

1 participant