From 9b8d9280acfc4504b2c519feb3eae55d6c813920 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 11:13:17 +1000 Subject: [PATCH] Fixed a logging bug. --- connection.go | 2 +- fuseops/common_op.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index 5bdc337..65796e7 100644 --- a/connection.go +++ b/connection.go @@ -261,7 +261,7 @@ func (c *Connection) ReadOp() (op fuseops.Op, err error) { } // Log the receipt of the operation. - c.debugLog(opID, 1, "<- %v", op) + c.debugLog(opID, 1, "<- %v", op.ShortDesc()) // Special case: responding to statfs is required to make mounting work on // OS X. We don't currently expose the capability for the file system to diff --git a/fuseops/common_op.go b/fuseops/common_op.go index 1339b02..c083b1c 100644 --- a/fuseops/common_op.go +++ b/fuseops/common_op.go @@ -80,9 +80,11 @@ func (o *commonOp) ShortDesc() (desc string) { opName = opName[len(prefix) : len(opName)-len(suffix)] } + desc = opName + // Include the inode number to which the op applies, if possible. if f := v.Elem().FieldByName("Inode"); f.IsValid() { - desc = fmt.Sprintf("%s(inode=%v)", opName, f.Interface()) + desc = fmt.Sprintf("%s(inode=%v)", desc, f.Interface()) } return