chore: add trace log for writeWithTimeout

This commit is contained in:
Siyuan Miao 2025-09-12 12:50:46 +02:00
parent e32a265836
commit d05ed45871
1 changed files with 6 additions and 0 deletions

View File

@ -121,6 +121,12 @@ func (u *UsbGadget) writeWithTimeout(file *os.File, data []byte) (n int, err err
return
}
u.log.Trace().
Str("file", file.Name()).
Bytes("data", data).
Err(err).
Msg("write failed")
if errors.Is(err, os.ErrDeadlineExceeded) {
u.logWithSuppression(
fmt.Sprintf("writeWithTimeout_%s", file.Name()),