log

package
v2.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSON

func ParseJSON(config latest.JSONParseConfig, line string) string

Types

type Formatter

type Formatter interface {
	Name() string

	PrintLine(io.Writer, string)
}

type Logger

type Logger interface {
	// Start starts the logger.
	Start(context.Context, io.Writer) error

	// Stop stops the logger.
	Stop()

	// Mute mutes the logger.
	Mute()

	// Unmute unmutes the logger.
	Unmute()

	// SetSince sets the original timestamp for the logger.
	SetSince(time.Time)

	// RegisterArtifacts tracks build artifacts inside of a logger.
	// The logger sometimes uses information about the currently deployed artifacts
	// to actually retrieve logs (e.g. the Kubernetes PodSelector). Thus, we need to
	// track the current build artifacts in the logger.
	RegisterArtifacts([]graph.Artifact)
}

Logger defines the behavior of the object that retrieves logs from deployed resources. Logger implementations are platform-specific, and are controlled by a single Deployer.

type LoggerMux

type LoggerMux []Logger

func (LoggerMux) Mute

func (l LoggerMux) Mute()

func (LoggerMux) RegisterArtifacts

func (l LoggerMux) RegisterArtifacts(artifacts []graph.Artifact)

func (LoggerMux) SetSince

func (l LoggerMux) SetSince(t time.Time)

func (LoggerMux) Start

func (l LoggerMux) Start(ctx context.Context, out io.Writer) error

func (LoggerMux) Stop

func (l LoggerMux) Stop()

func (LoggerMux) Unmute

func (l LoggerMux) Unmute()

type NoopLogger

type NoopLogger struct{}

NoopLogger is used in tests. It will never retrieve any logs from any resources.

func (*NoopLogger) Mute

func (n *NoopLogger) Mute()

func (*NoopLogger) RegisterArtifacts

func (n *NoopLogger) RegisterArtifacts(_ []graph.Artifact)

func (*NoopLogger) SetSince

func (n *NoopLogger) SetSince(time.Time)

func (*NoopLogger) Start

func (n *NoopLogger) Start(context.Context, io.Writer) error

func (*NoopLogger) Stop

func (n *NoopLogger) Stop()

func (*NoopLogger) Unmute

func (n *NoopLogger) Unmute()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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