log

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Storage = "stor_name"
	Object  = "obj_name"
	Bucket  = "bucket"
	Method  = "method"

	TraceID = "trace_id"
)

Variables

This section is empty.

Functions

func CreateLogger

func CreateLogger(cfg *Config, app, appID string) zerolog.Logger

func GetLogger

func GetLogger(cfg *Config, app, appID string) zerolog.Logger

func HttpMiddleware

func HttpMiddleware(cfg *Config, app, appID string, next http.Handler) http.Handler

func StartNew

func StartNew(from context.Context) (context.Context, context.CancelFunc)

func StreamInterceptor

func StreamInterceptor(cfg *Config, app, appID string) grpc.StreamServerInterceptor

func UnaryInterceptor

func UnaryInterceptor(cfg *Config, app, appID string) grpc.UnaryServerInterceptor

func WithBucket

func WithBucket(ctx context.Context, bucket string) context.Context

func WithFlow

func WithFlow(ctx context.Context, f xctx.Flow) context.Context

func WithMethod

func WithMethod(ctx context.Context, method s3.Method) context.Context

func WithObjName

func WithObjName(ctx context.Context, objName string) context.Context

func WithStorage

func WithStorage(ctx context.Context, storage string) context.Context

func WithTraceID

func WithTraceID(ctx context.Context, t string) context.Context

func WithUser

func WithUser(ctx context.Context, u string) context.Context

func WorkerMiddleware

func WorkerMiddleware(cfg *Config, app, appID string) asynq.MiddlewareFunc

Types

type Config

type Config struct {
	Json  bool   `yaml:"json"`
	Level string `yaml:"level"`
}

type Logger

type Logger struct{}

func NewStdLogger

func NewStdLogger() *Logger

func (*Logger) Debug

func (logger *Logger) Debug(args ...interface{})

func (*Logger) Error

func (logger *Logger) Error(args ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(args ...interface{})

func (*Logger) Info

func (logger *Logger) Info(args ...interface{})

func (*Logger) Printf

func (logger *Logger) Printf(ctx context.Context, format string, v ...interface{})

func (*Logger) Warn

func (logger *Logger) Warn(args ...interface{})

Jump to

Keyboard shortcuts

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