log

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	DebugLevel = LogLevel(zapcore.DebugLevel)
	// InfoLevel is the default logging priority.
	InfoLevel = LogLevel(zapcore.InfoLevel)
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	WarnLevel = LogLevel(zapcore.WarnLevel)
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	ErrorLevel = LogLevel(zapcore.ErrorLevel)
	// PanicLevel logs a message, then panics.
	PanicLevel = LogLevel(zapcore.PanicLevel)
	// FatalLevel logs a message, then calls os.Exit(1).
	FatalLevel = LogLevel(zapcore.FatalLevel)
)

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

Debug ...

func Debugf

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

Debugf ...

func Error

func Error(v ...interface{})

Error ...

func Errorf

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

Errorf ...

func Fatal

func Fatal(v ...interface{})

Fatal ...

func Fatalf

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

Fatalf ...

func Info

func Info(v ...interface{})

Info ...

func Infof

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

Infof ...

func Init

func Init(logPath string, level LogLevel)

func Panic

func Panic(v ...interface{})

Panic ...

func Panicf

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

Panicf ...

func SetLogger

func SetLogger(logger Logger)

SetLogger customize yourself logger.

func Warn

func Warn(v ...interface{})

Warn ...

func Warnf

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

Warnf ...

Types

type LogLevel

type LogLevel int8

LogLevel represents the level of logging.

func (*LogLevel) UnmarshalText

func (l *LogLevel) UnmarshalText(text []byte) error

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})

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

	Warn(v ...interface{})
	Warnf(format string, v ...interface{})

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

	Panic(v ...interface{})
	Panicf(format string, v ...interface{})

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

func GetLogger

func GetLogger() Logger

GetLogger get logger

Jump to

Keyboard shortcuts

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