types

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FitTextOptions

type FitTextOptions struct {
	ExtraIndentWidth int
	Width            int
	MaxWidth         int
	MarkWrappedLine  bool
}

type LogBlockInterface

type LogBlockInterface interface {
	Options(func(options LogBlockOptionsInterface)) LogBlockInterface
	Disable() LogBlockInterface
	Enable() LogBlockInterface
	Do(func())
	DoError(func() error) error
}

type LogBlockOptionsInterface

type LogBlockOptionsInterface interface {
	DisableIfLevelNotAccepted()
	Mute()
	WithIndent()
	WithoutLogOptionalLn()
	Style(color.Style)
}

type LogProcessInlineInterface

type LogProcessInlineInterface interface {
	Options(func(options LogProcessInlineOptionsInterface)) LogProcessInlineInterface
	Disable() LogProcessInlineInterface
	Enable() LogProcessInlineInterface
	Do(func())
	DoError(func() error) error
}

type LogProcessInlineOptionsInterface

type LogProcessInlineOptionsInterface interface {
	DisableIfLevelNotAccepted()
	Mute()
	Style(color.Style)
}

type LogProcessInterface

type LogProcessInterface interface {
	Options(func(options LogProcessOptionsInterface)) LogProcessInterface
	Disable() LogProcessInterface
	Enable() LogProcessInterface
	Do(func())
	DoError(func() error) error
	Start()
	StepEnd(format string, a ...interface{})
	End()
	Fail()
}

type LogProcessOptionsInterface

type LogProcessOptionsInterface interface {
	DisableIfLevelNotAccepted()
	Mute()
	WithIndent()
	WithoutLogOptionalLn()
	WithoutElapsedTime()
	InfoSectionFunc(func(err error))
	SuccessInfoSectionFunc(func())
	Style(color.Style)
}

type LoggerInterface

type LoggerInterface interface {
	ManagerLogInterface

	Error() ManagerInterface
	Warn() ManagerInterface
	Default() ManagerInterface
	Info() ManagerInterface
	Debug() ManagerInterface

	FitText(text string, options FitTextOptions) string
	Colorize(style color.Style, a ...interface{}) string
	ColorizeF(style color.Style, format string, a ...interface{}) string
	ColorizeLn(style color.Style, a ...interface{}) string

	AcceptedLevel() level.Level
	SetAcceptedLevel(lvl level.Level)
	IsAcceptedLevel(lvl level.Level) bool

	Streams() StreamsInterface
	OutStream() io.Writer
	ErrStream() io.Writer

	NewSubLogger(outStream, errStream io.Writer) LoggerInterface
	GetStreamsSettingsFrom(l LoggerInterface)

	Reset()
	ResetState()
	ResetModes()
}

type ManagerInterface

type ManagerInterface interface {
	ManagerLogInterface
	Stream() io.Writer

	SetStyle(style color.Style)
	Style() color.Style

	IsAccepted() bool
}

type ManagerLogInterface

type ManagerLogInterface interface {
	Log(a ...interface{})
	LogLn(a ...interface{})
	LogF(format string, a ...interface{})
	LogDetails(a ...interface{})
	LogLnDetails(a ...interface{})
	LogFDetails(format string, a ...interface{})
	LogHighlight(a ...interface{})
	LogLnHighlight(a ...interface{})
	LogFHighlight(format string, a ...interface{})
	LogWithCustomStyle(style color.Style, a ...interface{})
	LogLnWithCustomStyle(style color.Style, a ...interface{})
	LogFWithCustomStyle(style color.Style, format string, a ...interface{})
	LogOptionalLn()

	LogBlock(headerOrFormat string, a ...interface{}) LogBlockInterface
	LogProcessInline(headerOrFormat string, a ...interface{}) LogProcessInlineInterface
	LogProcess(headerOrFormat string, a ...interface{}) LogProcessInterface
}

type StreamsInterface

type StreamsInterface interface {
	Mute()
	Unmute()
	IsMuted() bool

	EnableGitlabCollapsibleSections()
	DisableGitlabCollapsibleSections()
	IsGitlabCollapsibleSections() bool

	DisablePrettyLog()

	DoWithProxyStreamDataFormatting(func())
	DoWithoutProxyStreamDataFormatting(func())
	DoErrorWithProxyStreamDataFormatting(func() error) error
	DoErrorWithoutProxyStreamDataFormatting(func() error) error
	EnableProxyStreamDataFormatting()
	DisableProxyStreamDataFormatting()
	IsProxyStreamDataFormattingEnabled() bool

	EnableLineWrapping()
	DisableLineWrapping()
	IsLineWrappingEnabled() bool

	EnableStyle()
	DisableStyle()
	IsStyleEnabled() bool

	Width() int
	SetWidth(value int)
	ContentWidth() int
	ServiceWidth() int

	DoWithIndent(func())
	DoErrorWithIndent(func() error) error
	DoWithoutIndent(func())
	DoErrorWithoutIndent(func() error) error
	IncreaseIndent()
	DecreaseIndent()
	ResetIndent()

	DoWithTag(value string, style color.Style, f func())
	DoErrorWithTag(value string, style color.Style, f func() error) error
	SetTag(value string)
	SetTagStyle(style color.Style)
	SetTagWithStyle(value string, style color.Style)
	ResetTag()

	EnablePrefixDuration()
	DisablePrefixDuration()
	IsPrefixDurationEnabled() bool
	ResetPrefixDurationStartTime()
	SetPrefixTimeFormat(format string)
	EnablePrefixTime()
	DisablePrefixTime()
	IsPrefixTimeEnabled() bool
	SetPrefix(value string)
	SetPrefixStyle(style color.Style)
	DisablePrefix()

	EnableLogProcessBorder()
	DisableLogProcessBorder()
	IsLogProcessBorderEnabled() bool
}

Jump to

Keyboard shortcuts

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