logging

package
v3.0.0-...-18a6489 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtxKey = ctxKey{}

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

Functions

This section is empty.

Types

type Host

type Host[L any] struct {
	// contains filtered or unexported fields
}

A user friendly interface to log against, shared by SDKv2 and PF providers.

Host[tfbridge.Log] implements [tfbridge.Logger].

Because [tfbridge.Logger] has a dependent type: [tfbridge.Log] and because we are unable to name either type here, we need to parameterize Host with `L`, where `L` is always [tfbridge.Log]. This allows us to return `L` from Host[tfbridge.Log].Status() and satisfy the [tfbridge.Logger] interface.

func NewHost

func NewHost[L any](ctx context.Context,
	sink Sink,
	urn resource.URN,
	mkStatus func(*Host[L]) L,
) *Host[L]

func (*Host[L]) Debug

func (l *Host[L]) Debug(msg string)

func (*Host[L]) Error

func (l *Host[L]) Error(msg string)

func (*Host[L]) Info

func (l *Host[L]) Info(msg string)

func (*Host[L]) Status

func (l *Host[L]) Status() L

func (*Host[L]) Warn

func (l *Host[L]) Warn(msg string)

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