diff --git a/client.go b/client.go index dab09ea9..4bd98f62 100644 --- a/client.go +++ b/client.go @@ -112,7 +112,7 @@ func Dial( tlsConf: tlsConf, config: clientConfig, version: version, - logger: utils.DefaultLogger, + logger: utils.DefaultLogger.WithPrefix("client"), } c.logger.Infof("Starting new connection to %s (%s -> %s), source connection ID %s, destination connection ID %s, version %s", hostname, c.conn.LocalAddr(), c.conn.RemoteAddr(), c.srcConnID, c.destConnID, c.version) diff --git a/h2quic/client.go b/h2quic/client.go index 40980882..af4ad11a 100644 --- a/h2quic/client.go +++ b/h2quic/client.go @@ -77,7 +77,7 @@ func newClient( opts: opts, headerErrored: make(chan struct{}), dialer: dialer, - logger: utils.DefaultLogger, + logger: utils.DefaultLogger.WithPrefix("client"), } } diff --git a/h2quic/server.go b/h2quic/server.go index a2412bd1..857211d2 100644 --- a/h2quic/server.go +++ b/h2quic/server.go @@ -90,7 +90,7 @@ func (s *Server) serveImpl(tlsConfig *tls.Config, conn net.PacketConn) error { if s.Server == nil { return errors.New("use of h2quic.Server without http.Server") } - s.logger = utils.DefaultLogger + s.logger = utils.DefaultLogger.WithPrefix("server") s.listenerMutex.Lock() if s.closed { s.listenerMutex.Unlock() diff --git a/integrationtests/tools/proxy/proxy.go b/integrationtests/tools/proxy/proxy.go index d12a3bae..d0bd9710 100644 --- a/integrationtests/tools/proxy/proxy.go +++ b/integrationtests/tools/proxy/proxy.go @@ -134,7 +134,7 @@ func NewQuicProxy(local string, version protocol.VersionNumber, opts *Opts) (*Qu dropPacket: packetDropper, delayPacket: packetDelayer, version: version, - logger: utils.DefaultLogger, + logger: utils.DefaultLogger.WithPrefix("proxy"), } p.logger.Debugf("Starting UDP Proxy %s <-> %s", conn.LocalAddr(), raddr) diff --git a/server.go b/server.go index 31b7911c..02a9d077 100644 --- a/server.go +++ b/server.go @@ -110,7 +110,7 @@ func Listen(conn net.PacketConn, tlsConf *tls.Config, config *Config) (Listener, sessionQueue: make(chan Session, 5), errorChan: make(chan struct{}), supportsTLS: supportsTLS, - logger: utils.DefaultLogger, + logger: utils.DefaultLogger.WithPrefix("server"), } if supportsTLS { if err := s.setupTLS(); err != nil {