log

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

Debug provides debug level logging

func Debugf

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

Debugf provides debug level logging

func Error

func Error(v ...interface{})

Error provides warn level logging

func Errorf

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

Errorf provides warn level logging

func Fatal

func Fatal(v ...interface{})

Fatal logs with Log and then exits with os.Exit(1)

func Fatalf

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

Fatalf logs with Logf and then exits with os.Exit(1)

func Info

func Info(v ...interface{})

Info provides info level logging

func Infof

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

Infof provides info level logging

func Log

func Log(v ...interface{})

Log makes use of Logger

func Logf

func Logf(format string, v ...interface{})

Logf makes use of Logger

func SetLevel

func SetLevel(l Level)

SetLevel sets the log level

func SetLogger

func SetLogger(l Logger)

SetLogger sets the local logger

func SetPrefix

func SetPrefix(p string)

SetPrefix sets a prefix for the logger

func WithLevel

func WithLevel(l Level, v ...interface{})

WithLevel logs with the level specified

func WithLevelf

func WithLevelf(l Level, format string, v ...interface{})

WithLevelf logs with the level specified

Types

type Level

type Level int

Level is a log level

const (
	// LevelFatal fatal level
	LevelFatal Level = iota + 1
	// LevelError error level
	LevelError
	// LevelInfo info level
	LevelInfo
	// LevelDebug debug level
	LevelDebug
)

func GetLevel

func GetLevel() Level

GetLevel returns the current level

func LevelType added in v0.0.5

func LevelType(level string) Level

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Log(v ...interface{})
	Logf(format string, v ...interface{})
}

Logger is a generic logging interface

func GetLogger

func GetLogger() Logger

GetLogger returns the local logger

Jump to

Keyboard shortcuts

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