Skip to content

Commit

Permalink
Improving fuse response log for better debuggability
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-prince committed Jun 25, 2024
1 parent 7285af0 commit a484376
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func (c *Connection) Reply(ctx context.Context, opErr error) error {
// Debug logging
if c.debugLogger != nil {
if opErr == nil {
c.debugLog(fuseID, 1, "-> OK (%s)", describeResponse(op))
c.debugLog(fuseID, 1, "-> %s", describeResponse(op))
} else {
c.debugLog(fuseID, 1, "-> Error: %q", opErr.Error())
}
Expand Down
3 changes: 1 addition & 2 deletions debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,10 @@ func describeResponse(op interface{}) string {
addComponent("inode %v", entry.Child)
}
}

switch typed := op.(type) {
case *fuseops.OpenFileOp:
addComponent("handle %d", typed.Handle)
}

return fmt.Sprintf("%s", strings.Join(components, ", "))
return fmt.Sprintf("%s (%s)", opName(op), strings.Join(components, ", "))
}

0 comments on commit a484376

Please sign in to comment.