forked from quic-go/quic-go
qlog: rename DefaultTracer to DefaultConnectionTracer (#4556)
This commit is contained in:
@@ -13,9 +13,15 @@ import (
|
||||
)
|
||||
|
||||
// DefaultTracer creates a qlog file in the qlog directory specified by the QLOGDIR environment variable.
|
||||
// Deprecated: use DefaultConnectionTracer instead.
|
||||
func DefaultTracer(ctx context.Context, p logging.Perspective, connID logging.ConnectionID) *logging.ConnectionTracer {
|
||||
return DefaultConnectionTracer(ctx, p, connID)
|
||||
}
|
||||
|
||||
// DefaultConnectionTracer creates a qlog file in the qlog directory specified by the QLOGDIR environment variable.
|
||||
// File names are <odcid>_<perspective>.qlog.
|
||||
// Returns nil if QLOGDIR is not set.
|
||||
func DefaultTracer(_ context.Context, p logging.Perspective, connID logging.ConnectionID) *logging.ConnectionTracer {
|
||||
func DefaultConnectionTracer(_ context.Context, p logging.Perspective, connID logging.ConnectionID) *logging.ConnectionTracer {
|
||||
var label string
|
||||
switch p {
|
||||
case logging.PerspectiveClient:
|
||||
|
||||
@@ -36,7 +36,7 @@ var _ = Describe("qlog dir tests", Serial, func() {
|
||||
qlogDir := path.Join(tempTestDirPath, "qlogs")
|
||||
err := os.Setenv("QLOGDIR", qlogDir)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
tracer := DefaultTracer(ctx, perspective, connID)
|
||||
tracer := DefaultConnectionTracer(ctx, perspective, connID)
|
||||
Expect(tracer).ToNot(BeNil())
|
||||
tracer.Close()
|
||||
_, err = os.Stat(qlogDir)
|
||||
@@ -50,7 +50,7 @@ var _ = Describe("qlog dir tests", Serial, func() {
|
||||
It("environment variable is not set", func() {
|
||||
err := os.Setenv("QLOGDIR", "")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
tracer := DefaultTracer(ctx, perspective, connID)
|
||||
tracer := DefaultConnectionTracer(ctx, perspective, connID)
|
||||
Expect(tracer).To(BeNil())
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user