netlog
The netlog crate is a reverse-engineered deserializer for the Chrome netlog format. It supports QUIC and HTTP(/2 and /3) events.
Overview
Chromium-based browsers allow users to enable detailed logging, netlog, which is useful for debugging interoperability or performance issues. A netlog file uses a kind of line-delimited JSON format. The first line contains "constants", which are specific to the version of the software used to generate the log. These constants are used for a form of compressed encoding for the netlog events that appear on each subsequent newline.
This crate supports parsing a netlog file and converting a subset of netlog events into Rust structures, via Serde.
Example usage
Assuming a netlog file name of chrome-net-export-log-error.json, the first
task is to create a BufReader for the file and initialize the netlog
constants.
use read_netlog_constants;
use File;
use BufReader;
let mut reader =
new;
let constants = read_netlog_constants.unwrap;
Then move on to parsing the netlog file until the end.
use read_netlog_record;
use EventHeader;
use Http2SessionEvent;
use QuicSessionEvent;
// The second line of a netlog is `"events" [`, which can be skipped over.
read_netlog_record;
while let Some = read_netlog_record