We've adopted `tracing` for diagnostics, but currently, it is just being used as a drop-in replacement for the `log` crate. Ideally, we would want to start emitting more structured diagnostics, using `tracing`'s `Span`s and structured key-value fields. A lot of the logging in `h2` is already written in a style that imitates the formatting of structured key-value logs, but as textual log messages. Migrating the logs to structured `tracing` events therefore is pretty easy to do. I've also started adding spans, mostly in the read path. Finally, I've updated the tests to use `tracing` rather than `env_logger`. The tracing setup happens in a macro, so that a span for each test with the test's name can be generated and entered. This will make the test output easier to read if multiple tests are run concurrently with `--nocapture`. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
		
			
				
	
	
		
			17 lines
		
	
	
		
			459 B
		
	
	
	
		
			TOML
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			459 B
		
	
	
	
		
			TOML
		
	
	
	
	
	
| [package]
 | |
| name = "h2-support"
 | |
| version = "0.1.0"
 | |
| authors = ["Carl Lerche <me@carllerche.com>"]
 | |
| edition = "2018"
 | |
| 
 | |
| [dependencies]
 | |
| h2 = { path = "../..", features = ["stream", "unstable"] }
 | |
| 
 | |
| bytes = "0.5"
 | |
| tracing = "0.1"
 | |
| tracing-subscriber = { version = "0.2", default-features = false, features = ["fmt", "chrono", "ansi"] }
 | |
| futures = { version = "0.3", default-features = false }
 | |
| http = "0.2"
 | |
| tokio = { version = "0.2", features = ["time"] }
 | |
| tokio-test = "0.2"
 |