doc.go 746 B

123456789101112131415
  1. // Package pdebug provides tools to produce debug logs the way the author
  2. // (Daisuke Maki a.k.a. lestrrat) likes. All of the functions are no-ops
  3. // unless you compile with the `-tags debug` option.
  4. //
  5. // When you compile your program with `-tags debug`, no trace is displayed,
  6. // but the code enclosed within `if pdebug.Enabled { ... }` is compiled in.
  7. // To show the debug trace, set the PDEBUG_TRACE environment variable to
  8. // true (or 1, or whatever `strconv.ParseBool` parses to true)
  9. //
  10. // If you want to show the debug trace regardless of an environment variable,
  11. // for example, perhaps while you are debugging or running tests, use the
  12. // `-tags debug0` build tag instead. This will enable the debug trace
  13. // forcefully
  14. package pdebug