loghelper

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Error = "error"

Variables

View Source
var InertDisplayer inertDisplayer //nolint

Functions

func BuildDisplayFunc

func BuildDisplayFunc(writer io.Writer, usedColor *color.Color) func(string)

func Concat

func Concat(parts ...string) string

func LevelWarnOrDebug

func LevelWarnOrDebug(debug bool) hclog.Level

func StdDisplay

func StdDisplay(msg string)

Types

type BasicDisplayer

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

func MakeBasicDisplayer

func MakeBasicDisplayer(logger hclog.Logger, display func(string)) BasicDisplayer

func (BasicDisplayer) Display

func (bd BasicDisplayer) Display(msg string)

func (BasicDisplayer) Flush

func (bd BasicDisplayer) Flush(bool)

func (BasicDisplayer) IsDebug

func (bd BasicDisplayer) IsDebug() bool

func (BasicDisplayer) Log

func (bd BasicDisplayer) Log(level hclog.Level, msg string, args ...any)

type Displayer

type Displayer interface {
	Display(msg string)
	IsDebug() bool
	Log(level hclog.Level, msg string, args ...any)
	Flush(logMode bool)
}

type StateWrapper

type StateWrapper struct {
	Displayer
}

func NewRecordingDisplayer

func NewRecordingDisplayer(displayer Displayer) *StateWrapper

func (*StateWrapper) Flush

func (sw *StateWrapper) Flush(logMode bool)

Jump to

Keyboard shortcuts

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