log_provider

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestId = "Request-Id"
	TraceId   = "trace-id"
	BizId     = "biz-id"
	UserId    = "user-id"
	UserName  = "username"
	IsAdmin   = "is_admin"
	ClientId  = "Client-Id"
)

Variables

This section is empty.

Functions

func GetBizId

func GetBizId(ctx context.Context) string

func GetRequestId

func GetRequestId(ctx context.Context) string

func GetTraceId

func GetTraceId(ctx context.Context) string

func NewTraceId

func NewTraceId() string

Types

type LocalFileLogLogger

type LocalFileLogLogger struct {
	Logger       *logrus.Logger
	CommonFields map[string]interface{}
}

func (LocalFileLogLogger) Error

func (s LocalFileLogLogger) Error(msg string, args ...map[string]interface{})

func (LocalFileLogLogger) ErrorF

func (s LocalFileLogLogger) ErrorF(msg string, err error, args ...map[string]interface{})

func (LocalFileLogLogger) Info

func (s LocalFileLogLogger) Info(msg string, args ...map[string]interface{})

func (LocalFileLogLogger) NewError

func (s LocalFileLogLogger) NewError(msg string, args ...map[string]interface{}) error

func (LocalFileLogLogger) NewErrorF

func (s LocalFileLogLogger) NewErrorF(msg string, err error, args ...map[string]interface{}) error

func (LocalFileLogLogger) Success

func (s LocalFileLogLogger) Success(msg string, args ...map[string]interface{}) string

func (LocalFileLogLogger) Warn

func (s LocalFileLogLogger) Warn(msg string, args ...map[string]interface{})

type LocalFileLogProvider

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

func NewLocalFileLogProvider

func NewLocalFileLogProvider(env *env.GlobalEnv) (*LocalFileLogProvider, error)

func (LocalFileLogProvider) NewLogger

func (p LocalFileLogProvider) NewLogger(commonField map[string]interface{}) Logger

type Logger

type Logger interface {
	Info(msg string, args ...map[string]interface{})
	Success(msg string, args ...map[string]interface{}) string
	Warn(msg string, args ...map[string]interface{})
	Error(msg string, args ...map[string]interface{})
	ErrorF(msg string, err error, args ...map[string]interface{})
	NewError(msg string, args ...map[string]interface{}) error
	NewErrorF(msg string, err error, args ...map[string]interface{}) error
}

type LoggerProvider

type LoggerProvider interface {
	NewLogger(commonField map[string]interface{}) Logger
}

LoggerProvider 日志收集器

Jump to

Keyboard shortcuts

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