ylog

package module
v0.0.0-...-44730d4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 9 Imported by: 2

README

ylog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogLevelToString

func LogLevelToString(level LogLevel) string

Types

type ILogger

type ILogger interface {
	HitLevel(level LogLevel) bool
	Trace(format string, args ...interface{})
	Debug(format string, args ...interface{})
	Info(format string, args ...interface{})
	Notice(format string, args ...interface{})
	Warn(format string, args ...interface{})
	Error(format string, args ...interface{})
	Panic(format string, args ...interface{})
	Fatal(format string, args ...interface{})
	AddLogChain(logger ILogger)
	AddSkipLevel()
}

func NewConsoleLogger

func NewConsoleLogger(level LogLevel, skip int) (ILogger, error)

func NewFileLogger

func NewFileLogger(path, prefix string, level LogLevel, skip int) (ILogger, error)

func NewWriterLogger

func NewWriterLogger(w io.Writer, level LogLevel, skip int) (ILogger, error)

type LogLevel

type LogLevel int
const (
	LogLevelInvalid LogLevel = iota
	LogLevelTrace
	LogLevelDebug
	LogLevelInfo
	LogLevelNotice
	LogLevelWarn
	LogLevelError
	LogLevelPanic
	LogLevelFatal
	LogLevelNone
)

func StringToLogLevel

func StringToLogLevel(level string) LogLevel

type Logger

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

func (*Logger) AddLogChain

func (l *Logger) AddLogChain(next ILogger)

func (*Logger) AddSkipLevel

func (l *Logger) AddSkipLevel()

func (*Logger) Debug

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

func (*Logger) Error

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

func (*Logger) Fatal

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

func (*Logger) HitLevel

func (l *Logger) HitLevel(level LogLevel) bool

func (*Logger) Info

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

func (*Logger) Notice

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

func (*Logger) Panic

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

func (*Logger) Trace

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

func (*Logger) Warn

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

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

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