logger

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTfLogger added in v1.51.0

func SetTfLogger(tfLogger *TfLogger)

Types

type TfLogger

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

func NewTfLogger added in v1.51.0

func NewTfLogger(ctx context.Context) *TfLogger

This function expects the context to have the logger key configured to hold the logger. Please see: GetProviderRootLogger defined in terraform-plugin-log here: https://github.com/hashicorp/terraform-plugin-log/blob/main/internal/logging/provider.go#L14 for reference.

func (*TfLogger) Debugf

func (tfLogger *TfLogger) Debugf(_ context.Context, format string, v ...any)

func (*TfLogger) Enabled

func (tfLogger *TfLogger) Enabled(_ context.Context, _ logger.Level) bool

This function is always enabled because TfLogger implements the Logger interface from Go SDK and there we check if the logging is enabled based on level (which default to Info). This however isn't possible here since tflog isn't enabled / disabled based on log level. Omitting is done internally through the `ShouldOmit` method that filters based on logger configurations.

func (*TfLogger) Errorf

func (tfLogger *TfLogger) Errorf(_ context.Context, format string, v ...any)

func (*TfLogger) Infof

func (tfLogger *TfLogger) Infof(_ context.Context, format string, v ...any)

func (*TfLogger) Tracef

func (tfLogger *TfLogger) Tracef(_ context.Context, format string, v ...any)

func (*TfLogger) Warnf

func (tfLogger *TfLogger) Warnf(_ context.Context, format string, v ...any)

Jump to

Keyboard shortcuts

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