trace

package
v2.1.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2021 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTraceWriter

func NewTraceWriter(w io.WriteCloser) *traceWriter

NewTraceWriter return a tracer that will write the trace into w

func NilTracer

func NilTracer() *nilTracer

NilTracer instantiate a no-tracer

Types

type Tracer

type Tracer interface {
	Close() error                      // To close file
	Print(vs ...interface{})           // like fmt.Print(a,b,c ...)
	Printf(f string, s ...interface{}) // like fmt.Printf("%d: %s",1254,"Hello")
	LogPacket(s string, p []byte)      // to dump packet like hexdump -C f
	IsOn() bool                        // To check if trace is enabled
}

Tracer is the interface for a Tracer. It is implemented as a full tracer : traceWriter a no-tracer: nilTracer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL