hyperium / h3

MIT License
595 stars 76 forks source link

add tracing instrumentation #247

Closed Ruben2424 closed 3 months ago

Ruben2424 commented 3 months ago

This adds tracing to most connection relevant functions. This should make it easier to debug.

seanmonstar commented 3 months ago

It'd be nice if tracing could be optional. I was recently reminded of the desire for this in h2: https://github.com/hyperium/h2/issues/713

Ruben2424 commented 3 months ago

@seanmonstar, I added features for h3 and h3-quinn to enable tracing. What do you think?

Ruben2424 commented 3 months ago

Looks good to me. For what it's worth, you can name it tracing. Under features in the Cargo.toml, it could be tracing = ["dep:tracing"]. I think something like that is cleaner, it doesn't need to include the prefix of the crate (like h3-) in its own features.

I added the prefix because it confused me to have two crates with the same feature in one repo. When I call cargo test --all --features=tracing does it compile h3 or h3-quinn with the tracing feature. Or both?