logs

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSmartTerminal

func IsSmartTerminal(w io.Writer) bool

IsSmartTerminal returns true if the writer w is a terminal AND we think that the terminal is smart enough to use VT escape codes etc.

func IsTerminal

func IsTerminal(w io.Writer) bool

IsTerminal returns true if the writer w is a terminal

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is the kind cli's log.Logger implementation

func NewLogger

func NewLogger(writer io.Writer, verbosity log.Level) *Logger

NewLogger returns a new Logger with the given verbosity

func (*Logger) ColorEnabled

func (l *Logger) ColorEnabled() bool

ColorEnabled returns true if the caller is OK to write colored output

func (*Logger) Error

func (l *Logger) Error(message string)

Error is part of the log.Logger interface

func (*Logger) Errorf

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

Errorf is part of the log.Logger interface

func (*Logger) SetVerbosity

func (l *Logger) SetVerbosity(verbosity log.Level)

SetVerbosity sets the loggers verbosity

func (*Logger) SetWriter

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

SetWriter sets the output writer

func (*Logger) V

func (l *Logger) V(level log.Level) log.InfoLogger

V is part of the log.Logger interface

func (*Logger) Warn

func (l *Logger) Warn(message string)

Warn is part of the log.Logger interface

func (*Logger) Warnf

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

Warnf is part of the log.Logger interface

Jump to

Keyboard shortcuts

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