logger

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// These flags define the different levels available for the logger
	LevelTrace = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal

	// Same as time.RFC3339Nano but with trailing 0 for seconds decimals
	PaddedRFC3339Nano = "2006-01-02T15:04:05.000000000Z07:00"
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func Fatal

func Fatal(args ...interface{})

func Fatalf

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

func Info

func Info(args ...interface{})

func Infof

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

func RedirectNativeLogger

func RedirectNativeLogger()

func SetLevel

func SetLevel(level int)

func SetOutput

func SetOutput(out io.Writer)

func Trace

func Trace(args ...interface{})

func Tracef

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

func Warn

func Warn(args ...interface{})

func Warnf

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

Types

type Logger

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

A Logger represents an active logging object that generates lines of output to an io.Writer.

func NewLogger

func NewLogger(level int) (l *Logger)

NewLogger creates a new Logger. The level variable sets the minimum log level to output Default output is os.Stderr

func (*Logger) Debug

func (l *Logger) Debug(args ...interface{})

Debug logs with Debug severity. Arguments are handled in the manner of fmt.Sprint

func (*Logger) Debugf

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

Debug logs with Debug severity. Arguments are handled in the manner of fmt.Sprintf

func (*Logger) Error

func (l *Logger) Error(args ...interface{})

Error logs with Error severity. Arguments are handled in the manner of fmt.Sprint

func (*Logger) Errorf

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

Error logs with Error severity. Arguments are handled in the manner of fmt.Sprintf

func (*Logger) Fatal

func (l *Logger) Fatal(args ...interface{})

Fatal logs with Fatal severity and follows with an os.Exit(1) Arguments are handled in the manner of fmt.Sprint

func (*Logger) Fatalf

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

Fatal logs with Fatal severity and follows with an os.Exit(1) Arguments are handled in the manner of fmt.Sprintf

func (*Logger) Info

func (l *Logger) Info(args ...interface{})

Info logs with Info severity. Arguments are handled in the manner of fmt.Sprint

func (*Logger) Infof

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

Info logs with Info severity. Arguments are handled in the manner of fmt.Sprintf

func (*Logger) RedirectNativeLogger

func (l *Logger) RedirectNativeLogger()

RedirectNativeLogger forces the native go logger to write in this instance and format accordingly

func (*Logger) SetLevel

func (l *Logger) SetLevel(level int)

SetLevel allows to set a log level for the logger

func (*Logger) SetOutput

func (l *Logger) SetOutput(out io.Writer)

SetOutput allows to set an output for the logger

func (*Logger) Trace

func (l *Logger) Trace(args ...interface{})

Trace logs with Trace severity. Arguments are handled in the manner of fmt.Sprint

func (*Logger) Tracef

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

Tracef logs with Trace severity. Arguments are handled in the manner of fmt.Sprintf

func (*Logger) Warn

func (l *Logger) Warn(args ...interface{})

Warn logs with Warn severity. Arguments are handled in the manner of fmt.Sprint

func (*Logger) Warnf

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

Warn logs with Warn severity. Arguments are handled in the manner of fmt.Sprintf

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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