Documentation
¶
Index ¶
- Constants
- func Assert(expr bool, v ...interface{})
- func Assertf(expr bool, f string, v ...interface{})
- func Disable()
- func Enable()
- func Enabled() bool
- func Output(skip int, msg string)
- func Print(v ...interface{})
- func Printf(f string, v ...interface{})
- func SetOutput(out io.Writer)
- func Shell(cmd string, args ...string)
- func Writer() *external.Writer
- type Debugger
- func (d *Debugger) Assert(expr bool, v ...interface{})
- func (d *Debugger) Assertf(expr bool, f string, v ...interface{})
- func (d *Debugger) Disable()
- func (d *Debugger) Enable()
- func (d *Debugger) Enabled() bool
- func (d *Debugger) Output(skip int, s string)
- func (d *Debugger) Print(v ...interface{})
- func (d *Debugger) Printf(f string, v ...interface{})
- func (d *Debugger) SetOutput(out io.Writer)
- func (d *Debugger) Write(data []byte) (int, error)
- func (d *Debugger) Writer() *external.Writer
- type Flag
Constants ¶
const EnableEnvVar = "ENABLE_DEBUG"
EnableEnvVar is the name of an environment variable that, if set, will enable this package's functionality.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
func Assert(expr bool, v ...interface{})
Assert will panic if expression is not true, but only if debugging is enabled
func Enabled ¶
func Enabled() bool
Enabled returns a bool indicating whether or not debugging is enabled
func Printf ¶
func Printf(f string, v ...interface{})
Printf prints message if debug logging is enabled.
Types ¶
type Debugger ¶
type Debugger struct {
// contains filtered or unexported fields
}
Debugger wraps a *log.Logger with some configuration and convenience methods
func NewDebugger ¶
NewDebugger creates a new *Debugger which logs to the supplied io.Writer
func (*Debugger) Assert ¶
Assert accepts a boolean expression and arguments, which if the expression is false, will be printed before panicing.
func (*Debugger) Assertf ¶
Assertf accepts a boolean expression and formatted arguments, which if the expression is false, will be printed before panicing.