logrus

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package logrus provides a logger implementation using the logrus library

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*logrus.Logger
}

Logger defines a Logger implemented by logrus

func NewLogger

func NewLogger() *Logger

NewLogger returns a Logger implemented by logrus

func (*Logger) Failf

func (l *Logger) Failf(format string, args ...interface{}) error

Failf logs a formatted error and returns it back

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

Printf prints a message in the log

func (*Logger) SetLevel

func (l *Logger) SetLevel(level log.Level)

SetLevel sets the log level

func (*Logger) SetWriter

func (l *Logger) SetWriter(w io.Writer)

SetWriter sets the internal writer used by the log

type SectionLogger

type SectionLogger struct {
	*Logger
}

SectionLogger defines a SectionLogger implemented by logrus

func NewSectionLogger

func NewSectionLogger() *SectionLogger

NewSectionLogger returns a new SectionLogger implemented by logrus

func (*SectionLogger) ExecuteStep

func (l *SectionLogger) ExecuteStep(title string, fn func() error) error

ExecuteStep executes a function while showing an indeterminate progress animation

func (*SectionLogger) PrefixText

func (l *SectionLogger) PrefixText(txt string) string

PrefixText returns the indented version of the provided text

func (*SectionLogger) ProgressBar

func (l *SectionLogger) ProgressBar() log.ProgressBar

ProgressBar returns a new silent progress bar

func (*SectionLogger) Section

func (l *SectionLogger) Section(title string, fn func(log.SectionLogger) error) error

Section executes the provided function inside a new section

func (*SectionLogger) StartSection

func (l *SectionLogger) StartSection(string) log.SectionLogger

StartSection starts a new log section

func (*SectionLogger) Successf

func (l *SectionLogger) Successf(format string, args ...interface{})

Successf logs a new success message (more efusive than Infof)

Jump to

Keyboard shortcuts

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