mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
use the prefix logger for client, server and proxy
This commit is contained in:
parent
d06957b8d8
commit
6b82e46e0c
5 changed files with 5 additions and 5 deletions
|
@ -112,7 +112,7 @@ func Dial(
|
||||||
tlsConf: tlsConf,
|
tlsConf: tlsConf,
|
||||||
config: clientConfig,
|
config: clientConfig,
|
||||||
version: version,
|
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)
|
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)
|
||||||
|
|
|
@ -77,7 +77,7 @@ func newClient(
|
||||||
opts: opts,
|
opts: opts,
|
||||||
headerErrored: make(chan struct{}),
|
headerErrored: make(chan struct{}),
|
||||||
dialer: dialer,
|
dialer: dialer,
|
||||||
logger: utils.DefaultLogger,
|
logger: utils.DefaultLogger.WithPrefix("client"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ func (s *Server) serveImpl(tlsConfig *tls.Config, conn net.PacketConn) error {
|
||||||
if s.Server == nil {
|
if s.Server == nil {
|
||||||
return errors.New("use of h2quic.Server without http.Server")
|
return errors.New("use of h2quic.Server without http.Server")
|
||||||
}
|
}
|
||||||
s.logger = utils.DefaultLogger
|
s.logger = utils.DefaultLogger.WithPrefix("server")
|
||||||
s.listenerMutex.Lock()
|
s.listenerMutex.Lock()
|
||||||
if s.closed {
|
if s.closed {
|
||||||
s.listenerMutex.Unlock()
|
s.listenerMutex.Unlock()
|
||||||
|
|
|
@ -134,7 +134,7 @@ func NewQuicProxy(local string, version protocol.VersionNumber, opts *Opts) (*Qu
|
||||||
dropPacket: packetDropper,
|
dropPacket: packetDropper,
|
||||||
delayPacket: packetDelayer,
|
delayPacket: packetDelayer,
|
||||||
version: version,
|
version: version,
|
||||||
logger: utils.DefaultLogger,
|
logger: utils.DefaultLogger.WithPrefix("proxy"),
|
||||||
}
|
}
|
||||||
|
|
||||||
p.logger.Debugf("Starting UDP Proxy %s <-> %s", conn.LocalAddr(), raddr)
|
p.logger.Debugf("Starting UDP Proxy %s <-> %s", conn.LocalAddr(), raddr)
|
||||||
|
|
|
@ -110,7 +110,7 @@ func Listen(conn net.PacketConn, tlsConf *tls.Config, config *Config) (Listener,
|
||||||
sessionQueue: make(chan Session, 5),
|
sessionQueue: make(chan Session, 5),
|
||||||
errorChan: make(chan struct{}),
|
errorChan: make(chan struct{}),
|
||||||
supportsTLS: supportsTLS,
|
supportsTLS: supportsTLS,
|
||||||
logger: utils.DefaultLogger,
|
logger: utils.DefaultLogger.WithPrefix("server"),
|
||||||
}
|
}
|
||||||
if supportsTLS {
|
if supportsTLS {
|
||||||
if err := s.setupTLS(); err != nil {
|
if err := s.setupTLS(); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue