log

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 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"}
	GolorGray   lipgloss.TerminalColor = lipgloss.CompleteColor{TrueColor: "#808080", ANSI256: "244", ANSI: "7"}
)

Functions

func ApplySettings added in v1.13.0

func ApplySettings(enableTags, disableTags string, enable, disable interface{})

func Bold

func Bold(s string) string

func Builder added in v1.11.6

func Builder(level Level, prefix string) builder

func Colorized added in v1.7.15

func Colorized() bool

func Colors added in v1.7.15

func Colors() int

func Cyan

func Cyan(s string) string

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Execution added in v1.13.0

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

func Failure added in v1.7.15

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

func Gray added in v1.3.0

func Gray(s string) string

func Green

func Green(s string) string

func Info

func Info(args ...interface{})

func InfoPad added in v1.5.0

func InfoPad(s string)

func Infof

func Infof(format string, args ...interface{})

func InitSettings added in v1.13.0

func InitSettings()

func LogMeta added in v1.7.15

func LogMeta(hookName string)

func Printf

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

func Println

func Println(args ...interface{})

func Red

func Red(s string) string

func Separate added in v1.5.0

func Separate(s string)

func SetColors

func SetColors(colors interface{})

func SetLevel

func SetLevel(level Level)

func SetName added in v1.1.3

func SetName(name string)

func SetOutput

func SetOutput(out io.Writer)

func Skip added in v1.13.0

func Skip(name, reason string)

func StartSpinner

func StartSpinner()

func StopSpinner

func StopSpinner()

func Success added in v1.7.15

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

func UnsetName added in v1.1.3

func UnsetName(name string)

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(format string, args ...interface{})

func Yellow

func Yellow(s string) string

Types

type Level

type Level uint32

func ParseLevel

func ParseLevel(lvl string) (Level, error)

type LogSettings added in v1.6.6

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

func NewSettings added in v1.6.6

func NewSettings() LogSettings

func (*LogSettings) Apply added in v1.6.6

func (s *LogSettings) Apply(enableTags, disableTags string, enable, disable interface{})

func (LogSettings) LogEmptySummary added in v1.6.6

func (s LogSettings) LogEmptySummary() bool

func (LogSettings) LogExecution added in v1.6.6

func (s LogSettings) LogExecution() bool

func (LogSettings) LogExecutionInfo added in v1.6.6

func (s LogSettings) LogExecutionInfo() bool

func (LogSettings) LogExecutionOutput added in v1.6.6

func (s LogSettings) LogExecutionOutput() bool

func (LogSettings) LogFailure added in v1.6.6

func (s LogSettings) LogFailure() bool

func (LogSettings) LogMeta added in v1.6.6

func (s LogSettings) LogMeta() bool

func (LogSettings) LogSkips added in v1.6.6

func (s LogSettings) LogSkips() bool

func (LogSettings) LogSuccess added in v1.6.6

func (s LogSettings) LogSuccess() bool

func (LogSettings) LogSummary added in v1.6.6

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 ...interface{})

func (*Logger) Error

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

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(args ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) IsLevelEnabled

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

func (*Logger) Log

func (l *Logger) Log(level Level, args ...interface{})

func (*Logger) Logf

func (l *Logger) Logf(level Level, format string, args ...interface{})

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

func (*Logger) Println

func (l *Logger) Println(args ...interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(level Level)

func (*Logger) SetName added in v1.1.3

func (l *Logger) SetName(name string)

func (*Logger) SetOutput

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

func (*Logger) UnsetName added in v1.1.3

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 ...interface{})

type StyleLogger added in v1.5.0

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

func Styled added in v1.5.0

func Styled() StyleLogger

func (StyleLogger) Info added in v1.5.0

func (s StyleLogger) Info(str string)

func (StyleLogger) WithLeftBorder added in v1.5.0

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

func (StyleLogger) WithPadding added in v1.5.0

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