logging

package
v3.82.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtxKey = ctxKey{}

The key used to retrieve tfbridge.Logger from a context.

Functions

func InitLogging added in v3.69.0

func InitLogging(ctx context.Context, opts LogOptions) context.Context

Sets up Context-scoped loggers to route Terraform logs to the Pulumi CLI process so they are visible to the user.

Log verbosity is controlled by the TF_LOG environment variable (set to TRACE, DEBUG, INFO, WARN, ERROR or OFF). By default, INFO-level logs are emitted.

See also:

- https://developer.hashicorp.com/terraform/plugin/log/writing - https://www.pulumi.com/docs/support/troubleshooting

Types

type LogOptions added in v3.69.0

type LogOptions struct {
	LogSink         Sink
	ProviderName    string
	ProviderVersion string
	URN             resource.URN
}

See InitLogging.

type Sink

type Sink interface {
	Log(context context.Context, sev diag.Severity, urn resource.URN, msg string) error
	LogStatus(context context.Context, sev diag.Severity, urn resource.URN, msg string) error
}

Abstracts the logging interface to HostClient. This is the interface providers use to report logging information back to the Pulumi CLI over gRPC.

Jump to

Keyboard shortcuts

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