Documentation
¶
Overview ¶
Package tracerx implements a simple tracer function that uses environment variables to control the output. It is a generalized package inspired by git's GIT_TRACE mechanism.
By default, tracerx will look for the TRACERX_TRACE environment variable. The default can by changed by setting the DefaultKey.
The values control where the tracing is output as follows:
unset, 0, or "false": no output 1, 2: stderr absolute path: output will be written to the file 3 - 10: output will be written to that file descriptor
By default, messages will be prefixed with "trace: ". This prefix can be modified by setting Prefix.
Each key can have an associated performance key, e.g. TRACERX_TRACE_PERFORMANCE. If this key is 1 or "true" performance output will be written to the same output as the tracing output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultKey = "TRACERX" Prefix = "trace: " )
Functions ¶
func Disable ¶
func Disable(key string)
Disable will disable tracing for the given key, regardless of the environment variable
func Enable ¶
func Enable(key string)
Enable will enable tracing for the given key, regardless of the environment variable
func PerformanceSince ¶
PerformanceSince writes out the time since the given time, if tracing for the default key is enabled and the performance key is set
func PerformanceSinceKey ¶
PerformanceSince writes out the time since the given time, if tracing for the given key is enabled and the performance key is set
Types ¶
This section is empty.