logging

package
v0.15.0-alpha20210107 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MPL-2.0 Imports: 10 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

func CurrentLogLevel() string

CurrentLogLevel returns the current log level string based the environment vars

func HCLogger

func HCLogger() hclog.Logger

HCLogger returns the default global hclog logger

func Indent

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 IsDebugOrHigher

func IsDebugOrHigher() bool

IsDebugOrHigher returns whether or not the current log level is debug or trace

func LogOutput

func LogOutput() io.Writer

LogOutput return the default global log io.Writer

func NewLogger

func NewLogger(name string) hclog.Logger

NewLogger returns a new logger based in the current global logger, with the given name appended.

func NewProviderLogger

func NewProviderLogger(prefix string) hclog.Logger

NewProviderLogger returns a logger for the provider plugin, possibly with a different log level from the global logger.

func PanicHandler

func PanicHandler(tmpLogPath string) panicwrap.HandlerFunc

panicHandler is what is called by panicwrap when a panic is encountered within Terraform. It is guaranteed to run after the resulting process has exited so we can take the log file, add in the panic, and store it somewhere locally.

func PluginPanics

func PluginPanics() []string

PluginPanics returns a series of provider panics that were collected during execution, and formatted for output.

func RegisterSink

func RegisterSink(f *os.File)

SetupTempLog 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