Documentation ¶
Index ¶
- type ColoredConsole
- func (c *ColoredConsole) AddToBuffer(scope string, buffer io.WriterTo)
- func (c *ColoredConsole) Flush(scope, header string)
- func (c *ColoredConsole) PrintProgressbarMessage(scope string, err error)
- func (c *ColoredConsole) RefreshProgressBar()
- func (c *ColoredConsole) StartBatchUpdate(repos []*domain.GitRepository)
- type ConsoleDiffPrinter
- type ConsoleLoggerFactory
- func (f *ConsoleLoggerFactory) NewGenericLogger(name string) logr.Logger
- func (f *ConsoleLoggerFactory) NewPipelineLogger(name string) *logging.PipelineLogger
- func (f *ConsoleLoggerFactory) NewRepositoryLogger(repository *domain.GitRepository) logr.Logger
- func (f *ConsoleLoggerFactory) SetLogLevel(level logging.LogLevel)
- type ConsoleSink
- func (t *ConsoleSink) Enabled(level int) bool
- func (t *ConsoleSink) Error(err error, msg string, keysAndValues ...interface{})
- func (t *ConsoleSink) Info(level int, msg string, keysAndValues ...interface{})
- func (t *ConsoleSink) Init(info logr.RuntimeInfo)
- func (t *ConsoleSink) WithLevelEnabled(level logging.LogLevel, enabled bool) *ConsoleSink
- func (t *ConsoleSink) WithName(name string) logr.LogSink
- func (t *ConsoleSink) WithValues(keysAndValues ...interface{}) logr.LogSink
- type DiffPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColoredConsole ¶
type ColoredConsole struct { // Quiet will redirect all console lines to an internal buffer if true. Quiet bool // contains filtered or unexported fields }
func NewColoredConsole ¶
func NewColoredConsole() *ColoredConsole
func (*ColoredConsole) AddToBuffer ¶
func (c *ColoredConsole) AddToBuffer(scope string, buffer io.WriterTo)
func (*ColoredConsole) Flush ¶
func (c *ColoredConsole) Flush(scope, header string)
Flush dumps the logging buffers to stdout. This is a noop if the buffers is empty.
func (*ColoredConsole) PrintProgressbarMessage ¶
func (c *ColoredConsole) PrintProgressbarMessage(scope string, err error)
func (*ColoredConsole) RefreshProgressBar ¶
func (c *ColoredConsole) RefreshProgressBar()
func (*ColoredConsole) StartBatchUpdate ¶
func (c *ColoredConsole) StartBatchUpdate(repos []*domain.GitRepository)
type ConsoleDiffPrinter ¶
type ConsoleDiffPrinter struct {
// contains filtered or unexported fields
}
ConsoleDiffPrinter prints a colored diff to console.
func NewConsoleDiffPrinter ¶
func NewConsoleDiffPrinter() *ConsoleDiffPrinter
NewConsoleDiffPrinter returns a new instance.
func (*ConsoleDiffPrinter) PrintDiff ¶
func (c *ConsoleDiffPrinter) PrintDiff(prefix, diff string)
PrintDiff implements DiffPrinter. The prefix is used to print a header before actually printing the diff.
type ConsoleLoggerFactory ¶
type ConsoleLoggerFactory struct {
// contains filtered or unexported fields
}
ConsoleLoggerFactory creates logr.Logger optimized for console CLI.
func NewConsoleLoggerFactory ¶
func NewConsoleLoggerFactory(sink *ConsoleSink) *ConsoleLoggerFactory
NewConsoleLoggerFactory wraps the given log sink.
func (*ConsoleLoggerFactory) NewGenericLogger ¶
func (f *ConsoleLoggerFactory) NewGenericLogger(name string) logr.Logger
NewGenericLogger implements logging.LoggerFactory.
func (*ConsoleLoggerFactory) NewPipelineLogger ¶
func (f *ConsoleLoggerFactory) NewPipelineLogger(name string) *logging.PipelineLogger
NewPipelineLogger implements logging.LoggerFactory.
func (*ConsoleLoggerFactory) NewRepositoryLogger ¶
func (f *ConsoleLoggerFactory) NewRepositoryLogger(repository *domain.GitRepository) logr.Logger
NewRepositoryLogger implements logging.LoggerFactory.
func (*ConsoleLoggerFactory) SetLogLevel ¶
func (f *ConsoleLoggerFactory) SetLogLevel(level logging.LogLevel)
SetLogLevel implements logging.LoggerFactory.
type ConsoleSink ¶
type ConsoleSink struct {
// contains filtered or unexported fields
}
ConsoleSink is a specialized logr.LogSink that uses plogr.PtermSink under the hood, but with extra features like suppression.
func NewConsoleSink ¶
func NewConsoleSink(console *ColoredConsole) *ConsoleSink
NewConsoleSink returns a new instance. There should only be 1 instance used per application.
func (*ConsoleSink) Enabled ¶
func (t *ConsoleSink) Enabled(level int) bool
Enabled implements logr.LogSink.
func (*ConsoleSink) Error ¶
func (t *ConsoleSink) Error(err error, msg string, keysAndValues ...interface{})
Error implements logr.LogSink. If the name is empty or if Quiet is false, the message is always printed to os.Stdout. If the name is non-empty, the message will be buffered internally to be printed at once later.
func (*ConsoleSink) Info ¶
func (t *ConsoleSink) Info(level int, msg string, keysAndValues ...interface{})
Info implements logr.LogSink. If the name is empty or if Quiet is false, the message is always printed to os.Stdout. If the name is non-empty, the message will be buffered internally to be printed at once later.
func (*ConsoleSink) Init ¶
func (t *ConsoleSink) Init(info logr.RuntimeInfo)
Init implements logr.LogSink. It will configure log levels that are defined in logging.LogLevel.
func (*ConsoleSink) WithLevelEnabled ¶
func (t *ConsoleSink) WithLevelEnabled(level logging.LogLevel, enabled bool) *ConsoleSink
WithLevelEnabled enables or disables the given log level, if existing.
func (*ConsoleSink) WithName ¶
func (t *ConsoleSink) WithName(name string) logr.LogSink
WithName implements logr.LogSink.
func (*ConsoleSink) WithValues ¶
func (t *ConsoleSink) WithValues(keysAndValues ...interface{}) logr.LogSink
WithValues implements logr.LogSink.
type DiffPrinter ¶
type DiffPrinter interface { // PrintDiff prints the diff. // The prefix can be used to identify which scope this diff belongs to. PrintDiff(prefix string, diff string) }
DiffPrinter is optimized for printing diff from Git output