log

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package log exposes the interface to implement as logger and provides some implementations.

Index

Constants

View Source
const Prefix = "goup: "

Prefix is the prefix used when logging.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger is the logger.

func DevNull

func DevNull() *Logger

DevNull is the default logger only used to mock the logger interface and do nothing else.

func New

func New(out io.Writer, tty bool) *Logger

New returns a new instance of a Logger.

func (*Logger) Debugf

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

Debugf implements the Printer interface.

func (*Logger) Errorf

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

Errorf implements the Printer interface.

func (*Logger) Infof

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

Infof implements the Printer interface.

func (*Logger) SetVerbose

func (l *Logger) SetVerbose(ok bool)

SetVerbose enabled verbose mode.

func (*Logger) Warnf

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

Warnf implements the Printer interface.

type Printer

type Printer interface {
	// Debugf logs a message at level Debug on the standard logger.
	Debugf(format string, args ...interface{})
	// Errorf logs a message at level Error on the standard logger.
	Errorf(format string, args ...interface{})
	// Infof logs a message at level Info on the standard logger.
	Infof(format string, args ...interface{})
	// Warnf logs a message at level Warn on the standard logger.
	Warnf(format string, args ...interface{})
}

Printer must be implemented to act as a logger for Go Up.

Jump to

Keyboard shortcuts

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