log

package
v0.0.0-...-06d884a Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TraceID = "trace_id"

TraceID trace id

Variables

This section is empty.

Functions

func GetLevel

func GetLevel() zapcore.Level

GetLevel 获取当前日志级别

func Init

func Init()

Init Setup init Logger

func SetLevel

func SetLevel(name string)

SetLevel 设置日志级别

Types

type Logger

type Logger struct {
	*zap.Logger
}

Logger logger 标准日志

func New

func New() *Logger

New Logger new Logger

func (*Logger) Print

func (l *Logger) Print(values ...interface{})

Print Gorm print

func (Logger) WithContext

func (l Logger) WithContext(c context.Context) Logger

WithContext 从上下文中获取 trace-id 并在日志中加入 trace-id 字段

Jump to

Keyboard shortcuts

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