tee

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close calls close on the global tee instance.

func Open

func Open(logFile string) error

Open will attempt to open the logFile for the global tee instance.

func Printf

func Printf(format string, args ...interface{}) (int, error)

Printf formats according to a format specifier and writes to the global tee.

func SetVerbose

func SetVerbose(verbose bool)

SetVerbose controls the verbosity of the global tee.

func VPrintf

func VPrintf(format string, args ...interface{}) (int, error)

VPrintf calls VPrintf on the global tee instance.

Types

type Tee

type Tee struct {
	Verbose bool
	// contains filtered or unexported fields
}

Tee emulates the Unix tee(1) command.

func NewOut

func NewOut(logFile string) (*Tee, error)

NewOut writes to standard output only. The file is created, not appended to.

func (*Tee) Close

func (t *Tee) Close() error

Close calls Close on the underlying file.

func (*Tee) Printf

func (t *Tee) Printf(format string, args ...interface{}) (int, error)

Printf formats according to a format specifier and writes to the tee instance.

func (*Tee) VPrintf

func (t *Tee) VPrintf(format string, args ...interface{}) (int, error)

VPrintf is a variant of Printf that only prints if the Tee's Verbose flag is set.

func (*Tee) Write

func (t *Tee) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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