debug.go 460 B

12345678910111213141516171819202122
  1. package fuse
  2. import (
  3. "runtime"
  4. )
  5. func stack() string {
  6. buf := make([]byte, 1024)
  7. return string(buf[:runtime.Stack(buf, false)])
  8. }
  9. func nop(msg interface{}) {}
  10. // Debug is called to output debug messages, including protocol
  11. // traces. The default behavior is to do nothing.
  12. //
  13. // The messages have human-friendly string representations and are
  14. // safe to marshal to JSON.
  15. //
  16. // Implementations must not retain msg.
  17. var Debug func(msg interface{}) = nop