Skip to content

Commit

Permalink
Convert srv.TermManager to use slog
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstimothy committed Dec 5, 2024
1 parent 7743ffb commit fa8f81f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/srv/termmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package srv

import (
"context"
"errors"
"io"
"log/slog"
"sync"
"sync/atomic"

log "github.com/sirupsen/logrus"
)

// maxHistoryBytes is the maximum bytes that are retained as history and broadcasted to new clients.
Expand Down Expand Up @@ -107,7 +107,7 @@ func (g *TermManager) writeToClients(p []byte) {
_, err := w.Write(p)
if err != nil {
if !errors.Is(err, io.EOF) {
log.Warnf("Failed to write to remote terminal: %v", err)
slog.WarnContext(context.Background(), "Failed to write to remote terminal", "error", err)
}
toDelete = append(
toDelete, struct {
Expand Down Expand Up @@ -244,7 +244,7 @@ func (g *TermManager) AddReader(name string, r io.Reader) {
n, err := r.Read(buf)
if err != nil {
if !errors.Is(err, io.EOF) {
log.Warnf("Failed to read from remote terminal: %v", err)
slog.WarnContext(context.Background(), "Failed to read from remote terminal", "error", err)
}
// Let term manager decide how to handle broken party readers.
if g.OnReadError != nil {
Expand Down

0 comments on commit fa8f81f

Please sign in to comment.