logger

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 7 Imported by: 14

README

go-logger

Documentation

Index

Constants

View Source
const (
	LogDebug = iota
	LogNotice
	LogSuccess
	LogFailed
	LogWarning
	LogError
	LogFatal
)

Variables

View Source
var LogLevelMap map[int]string

Functions

func Debug

func Debug(v ...interface{})

func Detail

func Detail(something interface{}) string

func Error

func Error(v ...interface{})

func Failed

func Failed(v ...interface{})

func Fatal

func Fatal(v ...interface{})

func GetLevel

func GetLevel() string

func Notice

func Notice(v ...interface{})

func SetLevel

func SetLevel(level string)

func SetLogger

func SetLogger(newlogger GoLogger)

func Success

func Success(v ...interface{})

func Warning

func Warning(v ...interface{})

Types

type CallerInfo

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

func GetCallerInfo

func GetCallerInfo(skip int) *CallerInfo

func (*CallerInfo) FileName

func (caller *CallerInfo) FileName() string

func (*CallerInfo) FuncName

func (caller *CallerInfo) FuncName() string

func (*CallerInfo) LineNumber

func (caller *CallerInfo) LineNumber() int

type GoLogger

type GoLogger interface {
	Debug(caller *CallerInfo, v ...interface{})
	Notice(caller *CallerInfo, v ...interface{})
	Warning(caller *CallerInfo, v ...interface{})
	Error(caller *CallerInfo, v ...interface{})
	Success(caller *CallerInfo, v ...interface{})
	Failed(caller *CallerInfo, v ...interface{})
	Fatal(caller *CallerInfo, v ...interface{})
}

func New

func New() GoLogger

Jump to

Keyboard shortcuts

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