trace

package
v0.107.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package trace implements a very simple tracing package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

type Flag struct {
	// contains filtered or unexported fields
}

A Flag represents a boolean value to be used as flag to enable or disable tracing output.

func NewFlag

func NewFlag(trace *Trace) *Flag

NewFlag returns a new Flag instance.

func (*Flag) IsBoolFlag

func (f *Flag) IsBoolFlag() bool

IsBoolFlag implements the flag.Value interface.

func (*Flag) Set

func (f *Flag) Set(s string) error

Set implements the flag.Value interface.

func (*Flag) String

func (f *Flag) String() string

type Trace

type Trace struct {
	*log.Logger
}

A Trace reprecents a tracing object.

func NewTrace

func NewTrace(prefix ...string) *Trace

NewTrace returns a new trace object.

func (*Trace) On

func (t *Trace) On() bool

On returns true if the tracing output is enabled, else otherwise.

func (*Trace) SetOn

func (t *Trace) SetOn(on bool)

SetOn enables or disabled the tracing output.

Jump to

Keyboard shortcuts

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