ansi

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logf

type Logf struct {
	// Prefix is a prefix to append to each message. You can leave this
	// empty.
	Prefix string

	// Ellipsis is what is appended to the end of each message when
	// truncating. You can leave this empty.
	Ellipsis string

	// Enable specifies whether you want to turn this on or not.
	Enable bool

	// Prefixes are a list of string prefixes to match when deciding to
	// delete a previous entry.
	Prefixes []string
	// contains filtered or unexported fields
}

Logf is a complex printing thing to do some ansi terminal escape sequence magic. FIXME: there might be bugs if Ellipsis is very big and Width is very small.

func (*Logf) Init

func (obj *Logf) Init() func(format string, v ...interface{})

Init must be called once before Logf is used. As a convenience, this returns the Logf function that you should use!

func (*Logf) Logf

func (obj *Logf) Logf(format string, v ...interface{})

Logf is the actual Logf function you should use. You must run Init before you use this.

Jump to

Keyboard shortcuts

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