log

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dummy = dummyLogger{}

Dummy is a dummy logger

Functions

func Debug

func Debug(args ...interface{})

Debug logs debug message

func Debugf

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

Debugf logs debug message

func Debugln

func Debugln(args ...interface{})

Debugln logs debug message

func Error

func Error(args ...interface{})

Error logs error message

func Errorf

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

Errorf logs error message

func Errorln

func Errorln(args ...interface{})

Errorln logs error message

func Fatal

func Fatal(args ...interface{})

Fatal logs fatal message

func Fatalf

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

Fatalf logs fatal message

func Fatalln

func Fatalln(args ...interface{})

Fatalln logs fatal message

func Info

func Info(args ...interface{})

Info logs info message

func Infof

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

Infof logs info message

func Infoln

func Infoln(args ...interface{})

Infoln logs info message

func Panic

func Panic(args ...interface{})

Panic logs panic message

func Panicf

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

Panicf logs panicln message

func Panicln

func Panicln(args ...interface{})

Panicln logs panicln message

func Set

func Set(level Level) error

Set will set the logger level

func Warn

func Warn(args ...interface{})

Warn logs warn message

func Warnf

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

Warnf logs warn message

func Warnln

func Warnln(args ...interface{})

Warnln logs warn message

Types

type Level

type Level string

Level refers to the level of logging

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{})
	Warningf(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
	Set(level Level) error
}

Logger is an interface that needs to be implemented in order to log.

func Base

func Base(json bool) Logger

Base returns the base logger

func With

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

With adds a key:value to the logger

func WithField

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

WithField adds a key:value to the logger

Jump to

Keyboard shortcuts

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