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

Adding optional tracing #328

Open
Nicceboy opened this issue Sep 15, 2024 · 7 comments
Open

Adding optional tracing #328

Nicceboy opened this issue Sep 15, 2024 · 7 comments
Labels
area/codec Related to a new or existing ASN.1 codec. good first issue Good for newcomers help wanted Extra attention is needed kind/enhancement New feature or request

Comments

@Nicceboy
Copy link
Contributor

For debugging purposes, it would be exceptionally useful if we add, for example tracing support as an optional compile-time feature. It will come with performance cost but reduces the need to split complex types for smaller parts to see what is wrong.

E.g. every encode/decode method could log the value, constraints, encoded length and encoded value bytes.

@XAMPPRocky
Copy link
Collaborator

Thank you for your issue! I'm unsure about it being a compile-time feature due to it creating a lot of code complexity. I think we can start with it included by default, and then run benchmarks on how much impact it would have, that would give us an informed opinion of the cost of having it there but not in use.

@Nicceboy
Copy link
Contributor Author

#![no_std] is likely the primary challenge again. Probably the shared functionality can be added as without feature requirements and then add default stdout or file-based subscriber as std feature.

@XAMPPRocky
Copy link
Collaborator

@Nicceboy
Copy link
Contributor Author

It is, but it cannot do anything useful without subscriber? E.g. write logs to file or print to stdout.

@XAMPPRocky
Copy link
Collaborator

Right, but we're a library, we don't need to setup a subscriber. Applications setup the subscriber.

@Nicceboy
Copy link
Contributor Author

Right, but we're a library, we don't need to setup a subscriber. Applications setup the subscriber.

Yeah, I think I was too focused on some easy default. I can try to implement this without subscriber at some point by using tracing crate.

@XAMPPRocky
Copy link
Collaborator

Yeah, you don't want to have a subscriber in the library because you want to give applications the maximum flexibility of where they log to. We can of course setup the benches and some tests with a subscriber of course for our own debugging.

@XAMPPRocky XAMPPRocky added kind/enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers area/codec Related to a new or existing ASN.1 codec. labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codec Related to a new or existing ASN.1 codec. good first issue Good for newcomers help wanted Extra attention is needed kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants