log

package
v0.0.0-...-4ff501c Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 6 Imported by: 0

README

log

log 重构思路

  • 定义 Logger 接口
  • zapLogger 是 Logger 的一个实现

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func C

func C(ctx context.Context) *zapLogger

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

func Infow

func Infow(msg string, keysAndValues ...interface{})

func Init

func Init(opts *Options)

func NewLogger

func NewLogger(opts *Options) *zapLogger

func Panicw

func Panicw(msg string, keysAndValues ...interface{})

func Sync

func Sync()

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Types

type Logger

type Logger interface {
	Debugw(msg string, keysAndValues ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})
	Sync()
}

type Options

type Options struct {
	DisableCaller     bool
	DisableStacktrace bool
	Level             string
	Format            string
	OutputPaths       []string
}

func NewOptions

func NewOptions() *Options

Jump to

Keyboard shortcuts

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