glogger

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 7 Imported by: 0

README

MSLoggger

基于ZAP封装的日志库

Documentation

Index

Constants

View Source
const (
	RequestID  string = "requestId"
	PlatformID string = "platformId"
	UserFlag   string = "userFlag"
	Duration   string = "duration"
	Size       string = "size"
)

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

func Error

func Error(msg string, fields ...zap.Field)

func Info

func Info(msg string, fields ...zap.Field)

Types

type FormatTemplateWithor added in v0.1.2

type FormatTemplateWithor interface {
}

type GLogger

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

func CreateLog

func CreateLog(gconfig GLoggerConfig) GLogger

func WithContext

func WithContext(ctx *context.Context) GLogger

func (GLogger) Debug

func (log GLogger) Debug(msg string, fields ...zap.Field)

func (GLogger) Error

func (log GLogger) Error(msg string, fields ...zap.Field)

func (GLogger) Errorf

func (log GLogger) Errorf(msg string, args ...interface{})

func (GLogger) Info

func (log GLogger) Info(msg string, fields ...zap.Field)

func (GLogger) Infof

func (log GLogger) Infof(msg string, args ...interface{})

func (GLogger) SetContext added in v0.1.2

func (log GLogger) SetContext(ctx *context.Context) GLogger

func (GLogger) Warnf

func (log GLogger) Warnf(msg string, args ...interface{})

func (GLogger) With

func (log GLogger) With(fields ...zap.Field) GLogger

func (GLogger) Withf added in v0.1.2

func (log GLogger) Withf(args []interface{}) *zap.SugaredLogger

TODO 待优化,既然格式一定,是不是可以暂时直接写死

type GLoggerConfig added in v0.1.2

type GLoggerConfig struct {
	OutputPath string
	Level      zapcore.Level
}

Directories

Path Synopsis
core

Jump to

Keyboard shortcuts

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