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.
Click to show internal directories.
Click to hide internal directories.