Documentation
¶
Overview ¶
Package trace traces function calls and steps in-between.
Index ¶
- type Result
- type Tracer
- func (t *Tracer) Call(args ...interface{}) func()
- func (t *Tracer) Call0() func()
- func (t *Tracer) Call1(arg1 string) func()
- func (t *Tracer) Call2(arg1, arg2 string) func()
- func (t *Tracer) Result(rv interface{}) Result
- func (t *Tracer) Step1(format string, arg0 string)
- func (t *Tracer) Step2(format string, arg0, arg1 string)
- func (t *Tracer) Stepf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result marks an argument of Tracer.Call as a result of that function. It is only logged when exiting from the function but not when entering it.
type Tracer ¶
Tracer produces a hierarchical structure of log events.
func (*Tracer) Call ¶
func (t *Tracer) Call(args ...interface{}) func()
Call records a function call in the tracing log, both when entering and when leaving the function.
Usage:
if trace.Tracing { defer trace.Call(arg1, arg2, trace.Result(result1), trace.Result(result2))() }
func (*Tracer) Call0 ¶
func (t *Tracer) Call0() func()
Call0 is used to trace a no-arguments function call.
Usage:
if trace.Tracing { defer trace.Call0()() }
func (*Tracer) Call1 ¶
Call1 is used to trace a function call with a single string argument.
Usage:
if trace.Tracing { defer trace.Call1(str1)() }
func (*Tracer) Call2 ¶
Call2 is used to trace a function call with 2 string arguments.
Usage:
if trace.Tracing { defer trace.Call2(str1, str2)() }
Click to show internal directories.
Click to hide internal directories.