prnt

package
v0.0.0-...-062bc9b Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Colors map[string]string
View Source
var DebugMode = false
View Source
var NoHumanOnly = false
View Source
var StderrLog = log.New(os.Stderr, "", 0)

Functions

func Colorize

func Colorize(str, colorKey string) string

func Fg

func Fg(colorKey string) string

func HPrint

func HPrint(level PrintType, v ...interface{})

func HPrintf

func HPrintf(level PrintType, format string, v ...interface{})

func HPrintln

func HPrintln(level PrintType, v ...interface{})

func IsTty

func IsTty() bool

IsTty returns true when stdout is a terminal.

func LHPrint

func LHPrint(level PrintType, humanOnly bool, v ...interface{})

func LHPrintf

func LHPrintf(level PrintType, humanOnly bool, format string, v ...interface{})

func LHPrintln

func LHPrintln(level PrintType, humanOnly bool, v ...interface{})

func LPrint

func LPrint(level PrintType, v ...interface{})

func LPrintf

func LPrintf(level PrintType, format string, v ...interface{})

func LPrintln

func LPrintln(level PrintType, v ...interface{})

func Print

func Print(v ...interface{})

func Printf

func Printf(format string, v ...interface{})

func Println

func Println(v ...interface{})

func Reset

func Reset() string

Types

type PrintLevel

type PrintLevel int
const (
	AlwaysLevel PrintLevel = iota
	QuietableLevel
	VerboseLevel
)
var LevelEnabled PrintLevel = QuietableLevel

type PrintType

type PrintType int
const (
	Always PrintType = iota
	Quietable
	Verbose
	Debug
)

type Printer

type Printer struct {
	// contains filtered or unexported fields
}
var Deb Printer
var Quiet Printer
var Verb Printer

func (*Printer) F

func (p *Printer) F(format string, v ...interface{})

func (*Printer) Ln

func (p *Printer) Ln(v ...interface{})

func (*Printer) P

func (p *Printer) P(v ...interface{})

type PrinterWrapper

type PrinterWrapper struct {
	Always  Printer
	Quiet   Printer
	Verbose Printer
	Debug   Printer
}
var Hum PrinterWrapper

type ProgressPrinter

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

func NewProgressPrinter

func NewProgressPrinter(total int) *ProgressPrinter

func (*ProgressPrinter) Progress

func (p *ProgressPrinter) Progress(n int)

n: The number of units to increment.

type Styler

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

func Style

func Style() *Styler

func (*Styler) Bold

func (s *Styler) Bold() *Styler

*

  • Bold applies bold styling.

func (*Styler) Codes

func (s *Styler) Codes() string

*

  • Codes returns the styling string.

func (*Styler) FgCyan

func (s *Styler) FgCyan() *Styler

*

  • FgCyan applies cyan foreground color.

func (*Styler) FgGreen

func (s *Styler) FgGreen() *Styler

*

  • FgGreen applies green foreground color.

func (*Styler) FgMagenta

func (s *Styler) FgMagenta() *Styler

*

  • FgMagenta applies magenta foreground color.

func (*Styler) FgRed

func (s *Styler) FgRed() *Styler

*

  • FgRed applies red foreground color.

func (*Styler) FgYellow

func (s *Styler) FgYellow() *Styler

*

  • FgYellow applies yellow foreground color.

func (*Styler) Normal

func (s *Styler) Normal() *Styler

func (*Styler) On

func (s *Styler) On(str string) string

*

  • On applies the styling to the given string, if enabled.

Jump to

Keyboard shortcuts

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