Commit 464d6053 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Limit the size of the debug output.

parent 836eae4b
......@@ -372,8 +372,14 @@ func dispatch(state *MountState, h *InHeader, arg *bytes.Buffer) (outBytes [][]b
}
if state.Debug {
val := fmt.Sprintf("%v", out)
max := 1024
if len(val) > max {
val = val[:max] + fmt.Sprintf(" ...dropped %d bytes", len(val) - max)
}
log.Printf("Serialize: %v code: %v value: %v\n",
operationName(h.Opcode), errorString(status), out)
operationName(h.Opcode), errorString(status), val)
}
return serialize(h, status, out)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment