logging

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// LevelWarn is the warning logging level.
	LevelWarn = 2
	// LevelInfo is the info logging level.
	LevelInfo = 0
	// LevelDebug is the debug logging level.
	LevelDebug = 1
	// LevelSuccess is the success logging level.
	LevelSuccess = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscardLoggerFactory

type DiscardLoggerFactory struct{}

DiscardLoggerFactory creates logr.Logger that discard everything.

func (*DiscardLoggerFactory) NewGenericLogger

func (d *DiscardLoggerFactory) NewGenericLogger(_ string) logr.Logger

func (*DiscardLoggerFactory) NewPipelineLogger

func (d *DiscardLoggerFactory) NewPipelineLogger(name string) *PipelineLogger

func (*DiscardLoggerFactory) NewRepositoryLogger

func (d *DiscardLoggerFactory) NewRepositoryLogger(_ *domain.GitRepository) logr.Logger

func (*DiscardLoggerFactory) SetLogLevel

func (d *DiscardLoggerFactory) SetLogLevel(_ LogLevel)

type LogLevel

type LogLevel int

LogLevel represents the verbosity of application events.

func ParseLevelOrDefault

func ParseLevelOrDefault(level string, def LogLevel) LogLevel

ParseLevelOrDefault returns the parsed LogLevel from a given string. If it cannot be parsed, it returns the given default.

type LoggerFactory

type LoggerFactory interface {
	NewGenericLogger(name string) logr.Logger
	NewRepositoryLogger(repository *domain.GitRepository) logr.Logger
	NewPipelineLogger(name string) *PipelineLogger
	SetLogLevel(level LogLevel)
}

func NewDiscardLoggerFactory

func NewDiscardLoggerFactory() LoggerFactory

NewDiscardLoggerFactory returns a factory that creates DiscardLogger.

type PipelineLogger

type PipelineLogger struct {
	Logger logr.Logger
}

PipelineLogger is the implementation for the pipeline lib.

func (PipelineLogger) Accept

func (p PipelineLogger) Accept(step pipeline.Step)

Accept prints the scope to debug level.

Jump to

Keyboard shortcuts

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