chore: ensure logs consistency across Coder (#8083)

This commit is contained in:
Marcin Tojek
2023-06-20 12:30:45 +02:00
committed by GitHub
parent d6f8bd7847
commit b1d1b63113
19 changed files with 132 additions and 57 deletions
+1 -1
View File
@@ -231,7 +231,7 @@ func NewConn(options *Options) (conn *Conn, err error) {
}
}()
wireguardEngine.SetStatusCallback(func(s *wgengine.Status, err error) {
server.logger.Debug(context.Background(), "wireguard status", slog.F("status", s), slog.F("err", err))
server.logger.Debug(context.Background(), "wireguard status", slog.F("status", s), slog.Error(err))
if err != nil {
return
}
+2 -2
View File
@@ -332,7 +332,7 @@ func (c *coordinator) ServeClient(conn net.Conn, id uuid.UUID, agent uuid.UUID)
for {
err := c.handleNextClientMessage(id, agent, decoder)
if err != nil {
logger.Debug(ctx, "unable to read client update; closed conn?", slog.Error(err))
logger.Debug(ctx, "unable to read client update, connection may be closed", slog.Error(err))
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrClosedPipe) || errors.Is(err, context.Canceled) {
return nil
}
@@ -469,7 +469,7 @@ func (c *coordinator) ServeAgent(conn net.Conn, id uuid.UUID, name string) error
for {
err := c.handleNextAgentMessage(id, decoder)
if err != nil {
logger.Debug(ctx, "unable to read agent update; closed conn?", slog.Error(err))
logger.Debug(ctx, "unable to read agent update, connection may be closed", slog.Error(err))
if errors.Is(err, io.EOF) || errors.Is(err, io.ErrClosedPipe) || errors.Is(err, context.Canceled) {
return nil
}