Documentation ¶
Overview ¶
Package dbg implements a debug printer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugPrinter ¶
type DebugPrinter struct { // If Enabled is false, the print statements won't do anything. Enabled bool // contains filtered or unexported fields }
A DebugPrinter is a drop-in replacement for fmt.Print*, and also acts as an io.WriteCloser when enabled.
func ToFile ¶
func ToFile(path string) (*DebugPrinter, error)
ToFile sets up a new DebugPrinter to a file, truncating it if it exists.
func (*DebugPrinter) Close ¶
func (dbg *DebugPrinter) Close() error
Close satisfies the Closer interface.
func (*DebugPrinter) Print ¶
func (dbg *DebugPrinter) Print(v ...interface{})
Print calls fmt.Print if Enabled is true.
func (*DebugPrinter) Printf ¶
func (dbg *DebugPrinter) Printf(format string, v ...interface{})
Printf calls fmt.Printf if Enabled is true.
func (*DebugPrinter) Println ¶
func (dbg *DebugPrinter) Println(v ...interface{})
Println calls fmt.Println if Enabled is true.
Click to show internal directories.
Click to hide internal directories.