Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug logs a message at level Debug on the standard logger.

func Debugf

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

Debugf logs a message at level Debug on the standard logger.

func Debugln

func Debugln(args ...interface{})

Debug logs a message at level Debug on the standard logger.

func Error

func Error(args ...interface{})

Error logs a message at level Error on the standard logger.

func Errorf

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

Errorf logs a message at level Error on the standard logger.

func Errorln

func Errorln(args ...interface{})

Error logs a message at level Error on the standard logger.

func Fatal

func Fatal(args ...interface{})

Fatal logs a message at level Fatal on the standard logger.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a message at level Fatal on the standard logger.

func Fatalln

func Fatalln(args ...interface{})

Fatal logs a message at level Fatal on the standard logger.

func Info

func Info(args ...interface{})

Info logs a message at level Info on the standard logger.

func Infof

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

Infof logs a message at level Info on the standard logger.

func Infoln

func Infoln(args ...interface{})

Info logs a message at level Info on the standard logger.

func NewLogWriter

func NewLogWriter(logFunc func(args ...interface{})) io.Writer

Creates a new io.Writer which writes to the log output. Takes a log function to use for writing output.

func Panic

func Panic(args ...interface{})

Panic logs a message at level Panic on the standard logger.

func Panicf

func Panicf(format string, args ...interface{})

Panicf logs a message at level Panic on the standard logger.

func Panicln

func Panicln(args ...interface{})

Panicln logs a message at level Panic on the standard logger.

func Warn

func Warn(args ...interface{})

Warn logs a message at level Warn on the standard logger.

func Warnf

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

Warnf logs a message at level Warn on the standard logger.

func Warnln

func Warnln(args ...interface{})

Warn logs a message at level Warn on the standard logger.

Types

type Fields

type Fields logrus.Fields

Fields aliases logrus.Fields

type LogWriter

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

Implements an io.Writer which writes its output to the given logging function. This allows, for example, easy streaming of command logs to the standard logging functions.

func (*LogWriter) Write

func (this *LogWriter) Write(p []byte) (n int, err error)

type Logger

type Logger interface {
	Debug(...interface{})
	Debugln(...interface{})
	Debugf(string, ...interface{})

	Info(...interface{})
	Infoln(...interface{})
	Infof(string, ...interface{})

	Warn(...interface{})
	Warnln(...interface{})
	Warnf(string, ...interface{})

	Error(...interface{})
	Errorln(...interface{})
	Errorf(string, ...interface{})

	Fatal(...interface{})
	Fatalln(...interface{})
	Fatalf(string, ...interface{})

	Panic(...interface{})
	Panicln(...interface{})
	Panicf(string, ...interface{})

	With(key string, value interface{}) Logger
	WithField(key string, value interface{}) Logger

	WithError(err error) Logger
	WithFields(fields Fields) Logger
}

func Base

func Base() Logger

func With

func With(key string, value interface{}) Logger

func WithError

func WithError(err error) Logger

func WithField

func WithField(key string, value interface{}) Logger

func WithFields

func WithFields(fields Fields) Logger

Jump to

Keyboard shortcuts

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