logging

package
v3.0.0-...-3d101a0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DedupLogger

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

DedupLogger wraps a time-ordered log set to allow batched logging of unique messages. Operations on DedupLogger are safe to use concurrently.

func NewLogger

func NewLogger(ctx context.Context, host *provider.HostClient, urn resource.URN) *DedupLogger

NewLogger returns an initialized DedupLogger.

func (*DedupLogger) EnqueueMessage

func (l *DedupLogger) EnqueueMessage(severity diag.Severity, s string)

EnqueueMessage adds a message to the log set but does not log it to the host.

func (*DedupLogger) GetNewMessages

func (l *DedupLogger) GetNewMessages() []logging.Message

GetNewMessages returns the list of new messages since last calling GetNewMessages.

func (*DedupLogger) LogMessage

func (l *DedupLogger) LogMessage(msg logging.Message)

LogMessage adds a message to the log set and flushes the queue to the host.

func (*DedupLogger) LogNewMessages

func (l *DedupLogger) LogNewMessages()

LogNewMessages logs any new messages to the host.

type TimeOrderedLogSet

type TimeOrderedLogSet struct {
	Messages logging.Messages
	// contains filtered or unexported fields
}

TimeOrderedLogSet stores a temporally-ordered set of log messages.

func (*TimeOrderedLogSet) Add

func (o *TimeOrderedLogSet) Add(msg logging.Message)

Add appends a message to the time-ordered set.

Jump to

Keyboard shortcuts

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