or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

bpf.mdcontext-ctxhttp.mdcontext.mddict.mddns-dnsmessage.mdhtml-atom.mdhtml-charset.mdhtml.mdhttp-httpguts.mdhttp-httpproxy.mdhttp2-h2c.mdhttp2-hpack.mdhttp2.mdicmp.mdidna.mdindex.mdipv4.mdipv6.mdnettest.mdnetutil.mdproxy.mdpublicsuffix.mdquic-qlog.mdquic.mdtrace.mdwebdav.mdwebsocket.mdxsrftoken.md
tile.json

quic-qlog.mddocs/

QUIC Logging

Package qlog serializes qlog events.

Import

import "golang.org/x/net/quic/qlog"

Constants

const (
    // VantageEndpoint traces contain events not specific to a single connection
    VantageEndpoint = Vantage("endpoint")

    // VantageClient traces follow a connection from the client's perspective
    VantageClient = Vantage("client")

    // VantageServer traces follow a connection from the server's perspective
    VantageServer = Vantage("server")
)

Types

Vantage

// Vantage is the vantage point from which a trace is recorded
type Vantage string

func (v Vantage) String() string

TraceInfo

// TraceInfo contains information about a trace
type TraceInfo struct {
    Vantage Vantage // Vantage point of the trace
    GroupID string  // Identifies the logical group the trace belongs to
}

Usage

This package is used internally by the quic package for logging QUIC protocol events in qlog format. Use the QLogLogger field in quic.Config to enable qlog logging.

Example with QUIC

import (
    "golang.org/x/net/quic"
    "log/slog"
    "os"
)

func setupQLogLogging() *quic.Config {
    // Create qlog logger
    qlogFile, err := os.Create("quic.qlog")
    if err != nil {
        panic(err)
    }

    logger := slog.New(slog.NewJSONHandler(qlogFile, &slog.HandlerOptions{
        Level: quic.QLogLevelPacket,
    }))

    return &quic.Config{
        QLogLogger: logger,
    }
}