mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
Merge pull request #2799 from lucas-clemente/optional-quic-trace
only include quic-trace when the quictrace build flag is set
This commit is contained in:
commit
06241f328d
3 changed files with 22 additions and 2 deletions
|
@ -256,8 +256,9 @@ type Config struct {
|
|||
StatelessResetKey []byte
|
||||
// KeepAlive defines whether this peer will periodically send a packet to keep the connection alive.
|
||||
KeepAlive bool
|
||||
// QUIC Event Tracer.
|
||||
// Warning: Experimental. This API should not be considered stable and will change soon.
|
||||
// QUIC Event Tracer (see https://github.com/google/quic-trace).
|
||||
// Warning: Support for quic-trace will soon be dropped in favor of qlog.
|
||||
// It is disabled by default. Use the "quictrace" build tag to enable (e.g. go build -tags quictrace).
|
||||
QuicTracer quictrace.Tracer
|
||||
Tracer logging.Tracer
|
||||
}
|
||||
|
|
17
quictrace/null_tracer.go
Normal file
17
quictrace/null_tracer.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
// +build !quictrace
|
||||
|
||||
package quictrace
|
||||
|
||||
import "github.com/lucas-clemente/quic-go/internal/protocol"
|
||||
|
||||
// NewTracer returns a new Tracer that doesn't do anything.
|
||||
func NewTracer() Tracer {
|
||||
return &nullTracer{}
|
||||
}
|
||||
|
||||
type nullTracer struct{}
|
||||
|
||||
var _ Tracer = &nullTracer{}
|
||||
|
||||
func (t *nullTracer) Trace(protocol.ConnectionID, Event) {}
|
||||
func (t *nullTracer) GetAllTraces() map[string][]byte { return make(map[string][]byte) }
|
|
@ -1,3 +1,5 @@
|
|||
// +build quictrace
|
||||
|
||||
package quictrace
|
||||
|
||||
import (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue