logging

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ValidLevels are the log level names that Terraform recognizes.
	ValidLevels = []string{"TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF"}
)

Functions

func CurrentLogLevel added in v0.3.0

func CurrentLogLevel(logConf v1.LogSpec) string

CurrentLogLevel returns the current log level string based the environment vars

func HCLogger added in v0.3.0

func HCLogger() hclog.Logger

HCLogger returns the default global hclog logger

func Indent added in v0.3.0

func Indent(s string) string

Indent adds two spaces to the beginning of each line of the given string, with the goal of making the log level filter understand it as a line continuation rather than possibly as new log lines.

func InitLogger

func InitLogger(conf v1.ConfigSpec)

func IsDebugOrHigher added in v0.3.0

func IsDebugOrHigher(logConf v1.LogSpec) bool

IsDebugOrHigher returns whether the current log level is debug or trace

func LogOutput added in v0.3.0

func LogOutput() io.Writer

LogOutput return the default global log io.Writer

func PanicHandler added in v0.3.0

func PanicHandler()

PanicHandler is called to recover from an internal panic in Terraform, and augments the standard stack trace with a more user-friendly error message. PanicHandler must be called as a deferred function, and must be the first defer called at the start of a new goroutine.

func RegisterSink added in v0.3.0

func RegisterSink(f *os.File)

RegisterSink adds a new log sink which writes all logs to the given file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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