Skip to content

Commit

Permalink
chore: add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Nov 14, 2024
1 parent de933be commit 35db438
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions remote_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func NewRemoteClientWriter(info *RemoteClientInfo, logger *slog.Logger, buffer i
}

func (c *RemoteClientWriter) Close() error {
c.Logger.Info("closing ssh conn", "host", c.Info.RemoteHost)
c.connecMu.Lock()
defer c.connecMu.Unlock()

Expand Down Expand Up @@ -85,6 +86,7 @@ func (c *RemoteClientWriter) Open(cmd string) error {
c.Done = make(chan struct{})
c.Messages = make(chan []byte, c.BufferSize)

c.Logger.Info("connecting to ssh conn", "host", c.Info.RemoteHost, "cmd", cmd)
sshClient, err := CreateRemoteClient(c.Info)
if err != nil {
c.connecMu.Unlock()
Expand Down Expand Up @@ -143,6 +145,7 @@ func (c *RemoteClientWriter) start() {
}

func (c *RemoteClientWriter) Write(data []byte) (int, error) {
c.Logger.Info("writing to ssh conn", "host", c.Info.RemoteHost)
var (
n int
err error
Expand Down

0 comments on commit 35db438

Please sign in to comment.