logger2

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 0 Imported by: 0

README

logger2

重构 logger,对其他 logger 进行封装,目前封装的有: zap

咋个使用,具体看 zap > *_test 文件,特性如下

  • 不使用 sugar
  • 兼容之前的 logger(除了 with)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatLogger

type FormatLogger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	Panicf(format string, args ...interface{})
}

FormatLogger 携带format的日志打印

type Logger

type Logger interface {
	StandardLogger
	FormatLogger

	Named(name string) Logger
	With(key string, value interface{}) Logger
}

type StandardLogger

type StandardLogger interface {
	Debug(msgs string)
	Info(msgs string)
	Warn(msgs string)
	Error(msgs string)
	Fatal(msgs string)
	Panic(msgs string)
}

StandardLogger 标准的日志打印

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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