Documentation ¶
Overview ¶
Package dbg provides yet another stylized debug printer.
Usage:
dbg.Style.Log(args...) dbg.Style.Logf(format, args...)
Where Style may be: NoOp, Plain, FileLine, or Func.
Nothing is printed with NoOp style, no args, or a nil args[0].
If args[0] is an error, both Log and Logf return that error; otherwise, these return nil. Use this to log a returned error,
return dbg.Style.Log(err)
Use style variables to selectively enable output,
// PACKAGE.go var Err = dbg.NoOp ... Err.Log(err) ... // PACKAGE_test.go func TestMain(m *testing.M) { flag.Parse() if testing.Verbose() { Err = dbg.FileLine } os.Exit(m.Run()) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.