Skip to content

Commit

Permalink
Reduce log noise
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Dec 21, 2023
1 parent 0c9e9f8 commit d7e3b53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions pkg/rigfs/winfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,13 @@ func (f *winFile) Seek(offset int64, whence int) (int64, error) {

// Write writes len(p) bytes from p to the remote file.
func (f *winFile) Write(p []byte) (int, error) {
log.Tracef("call write: %d", len(p))
if f.closed {
return 0, f.pathErr(OP_WRITE, fs.ErrClosed)
}
_, err := f.command(fmt.Sprintf("w %d", len(p)))
if err != nil {
return 0, f.pathErr(OP_WRITE, err)
}
log.Tracef("writing:\n%s", hex.Dump(p))
n, err := f.stdin.Write(p)
if err != nil {
return n, err
Expand All @@ -96,7 +94,6 @@ func (f *winFile) Write(p []byte) (int, error) {

// Read reads up to len(p) bytes from the remote file.
func (f *winFile) Read(p []byte) (int, error) {
log.Tracef("call read: %d", len(p))
if f.closed {
return 0, f.pathErr(OP_READ, fs.ErrClosed)
}
Expand All @@ -110,13 +107,12 @@ func (f *winFile) Read(p []byte) (int, error) {
total := 0
for total < int(resp.N) {
n, err := f.stdout.Read(p[total:resp.N])
log.Tracef("read %d bytes (total %d of %d)", n, total, resp.N)
if err != nil {
return total, err
}
total += n
}
log.Tracef("read total of %d bytes", total)
log.Tracef("read %d bytes", total)
return total, nil
}

Expand Down Expand Up @@ -208,7 +204,6 @@ func (f *winFile) command(cmd string) (*rcpResponse, error) {
close(resp)
return
}
log.Tracef("rigrcp raw response:\n%s", hex.Dump(b))
resp <- b[:len(b)-1] // drop the zero byte
}()
}
Expand Down
1 change: 0 additions & 1 deletion pkg/rigfs/winfsys.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ func (fsys *WinFsys) OpenFile(name string, flags int, _ fs.FileMode) (File, erro
name = ps.ToWindowsPath(name)
fi, err := fsys.Stat(name)
if err != nil && !errors.Is(err, fs.ErrNotExist) {
log.Debugf("stat %s: %+v", name, err)
return nil, &fs.PathError{Op: OP_OPEN, Path: name, Err: fmt.Errorf("stat: %w", err)}
}
var o opener
Expand Down

0 comments on commit d7e3b53

Please sign in to comment.