debug_off.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //+build !debug,!debug0
  2. package pdebug
  3. // Enabled is true if `-tags debug` or `-tags debug0` is used
  4. // during compilation. Use this to "ifdef-out" debug blocks.
  5. const Enabled = false
  6. // Trace is true if `-tags debug` is used AND the environment
  7. // variable `PDEBUG_TRACE` is set to a `true` value (i.e.,
  8. // 1, true, etc), or `-tags debug0` is used. This allows you to
  9. // compile-in the trace logs, but only show them when you
  10. // set the environment variable
  11. const Trace = false
  12. // IRelease is deprecated. Use Marker()/End() instead
  13. func (g guard) IRelease(f string, args ...interface{}) {}
  14. // IPrintf is deprecated. Use Marker()/End() instead
  15. func IPrintf(f string, args ...interface{}) guard { return guard{} }
  16. // Printf prints to standard out, just like a normal fmt.Printf,
  17. // but respects the indentation level set by IPrintf/IRelease.
  18. // Printf is no op unless you compile with the `debug` tag.
  19. func Printf(f string, args ...interface{}) {}
  20. // Dump dumps the objects using go-spew.
  21. // Dump is a no op unless you compile with the `debug` tag.
  22. func Dump(v ...interface{}) {}
  23. // Marker marks the beginning of an indented block. The message
  24. // you specify in the arguments is prefixed witha "START", and
  25. // subsequent calls to Printf will be indented one level more.
  26. //
  27. // To reset this, you must call End() on the guard object that
  28. // gets returned by Marker().
  29. func Marker(f string, args ...interface{}) *markerg { return emptyMarkerGuard }
  30. func (g *markerg) BindError(_ *error) *markerg { return g }
  31. func (g *markerg) End() {}