log

package
v2.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorLevel Level = iota
	WarnLevel
	InfoLevel
	DebugLevel

	ColorAuto = iota
	ColorOn
	ColorOff
)

Variables

View Source
var (
	ColorRed    lipgloss.TerminalColor = lipgloss.CompleteColor{TrueColor: "#ff6347", ANSI256: "196", ANSI: "9"}
	ColorGreen  lipgloss.TerminalColor = lipgloss.CompleteColor{TrueColor: "#32cd32", ANSI256: "148", ANSI: "2"}
	ColorYellow lipgloss.TerminalColor = lipgloss.CompleteColor{TrueColor: "#fada5e", ANSI256: "191", ANSI: "11"}
	ColorCyan   lipgloss.TerminalColor = lipgloss.CompleteColor{TrueColor: "#70C0BA", ANSI256: "37", ANSI: "14"}
	ColorGray   lipgloss.TerminalColor = lipgloss.CompleteColor{TrueColor: "#808080", ANSI256: "244", ANSI: "7"}
)

Functions

func ApplySettings

func ApplySettings(enableTags string, enable any)

func Bold

func Bold(s string) string

func Builder

func Builder(level Level, prefix string) builder

func Colorized

func Colorized() bool

func Colors

func Colors() int

func Cyan

func Cyan(s string) string

func Debug

func Debug(args ...any)

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(args ...any)

func Errorf

func Errorf(format string, args ...any)

func Execution

func Execution(name string, err error, out io.Reader)

func Failure

func Failure(indent int, name, failText string, duration time.Duration)

func Gray

func Gray(s string) string

func Green

func Green(s string) string

func Info

func Info(args ...any)

func InfoPad

func InfoPad(s string)

func Infof

func Infof(format string, args ...any)

func InitSettings

func InitSettings()

func LogMeta

func LogMeta(hookName string)

func LogSetup added in v2.1.2

func LogSetup(r io.Reader)

func Printf

func Printf(format string, args ...any)

func Println

func Println(args ...any)

func Red

func Red(s string) string

func Separate

func Separate(s string)

func SetColors

func SetColors(colors any)

func SetLevel

func SetLevel(level Level)

func SetName

func SetName(name string)

func SetOutput

func SetOutput(out io.Writer)

func Skip

func Skip(name, reason string)

func StartSpinner

func StartSpinner()

func StopSpinner

func StopSpinner()

func Success

func Success(indent int, name string, duration time.Duration)

func UnsetName

func UnsetName(name string)

func Warn

func Warn(args ...any)

func Warnf

func Warnf(format string, args ...any)

func Yellow

func Yellow(s string) string

Types

type Level

type Level uint32

func ParseLevel

func ParseLevel(lvl string) (Level, error)

type LogSettings

type LogSettings struct {
	// contains filtered or unexported fields
}
var Settings LogSettings

func NewSettings

func NewSettings() LogSettings

func (*LogSettings) Apply

func (s *LogSettings) Apply(enableTags string, enable any)

func (LogSettings) LogEmptySummary

func (s LogSettings) LogEmptySummary() bool

func (LogSettings) LogExecution

func (s LogSettings) LogExecution() bool

func (LogSettings) LogExecutionInfo

func (s LogSettings) LogExecutionInfo() bool

func (LogSettings) LogExecutionOutput

func (s LogSettings) LogExecutionOutput() bool

func (LogSettings) LogFailure

func (s LogSettings) LogFailure() bool

func (LogSettings) LogMeta

func (s LogSettings) LogMeta() bool

func (LogSettings) LogSetup added in v2.1.2

func (s LogSettings) LogSetup() bool

func (LogSettings) LogSkips

func (s LogSettings) LogSkips() bool

func (LogSettings) LogSuccess

func (s LogSettings) LogSuccess() bool

func (LogSettings) LogSummary

func (s LogSettings) LogSummary() bool

type Logger

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

func New

func New() *Logger

func (*Logger) Debug

func (l *Logger) Debug(args ...string)

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...any)

func (*Logger) Error

func (l *Logger) Error(args ...string)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...any)

func (*Logger) Info

func (l *Logger) Info(args ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...any)

func (*Logger) IsLevelEnabled

func (l *Logger) IsLevelEnabled(level Level) bool

func (*Logger) Log

func (l *Logger) Log(level Level, args ...any)

func (*Logger) Logf

func (l *Logger) Logf(level Level, format string, args ...any)

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...any)

func (*Logger) Println

func (l *Logger) Println(args ...any)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetName

func (l *Logger) SetName(name string)

func (*Logger) SetOutput

func (l *Logger) SetOutput(out io.Writer)

func (*Logger) UnsetName

func (l *Logger) UnsetName(name string)

func (*Logger) Warn

func (l *Logger) Warn(args ...string)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...any)

type StyleLogger

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

func Styled

func Styled() StyleLogger

func (StyleLogger) Info

func (s StyleLogger) Info(str string)

func (StyleLogger) WithLeftBorder

func (s StyleLogger) WithLeftBorder(border lipgloss.Border, color lipgloss.TerminalColor) StyleLogger

func (StyleLogger) WithPadding

func (s StyleLogger) WithPadding(m int) StyleLogger

Jump to

Keyboard shortcuts

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