logger

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger added in v3.3.1

func SetLogger(log Logger)

SetLogger sets logger for dubbo and getty

func SetLoggerLevel added in v3.3.1

func SetLoggerLevel(level string) bool

SetLoggerLevel is used to set the logger level.

Types

type Config added in v3.3.1

type Config struct {
	LumberjackConfig *lumberjack.Logger `yaml:"lumberjack-config"`
	ZapConfig        *zap.Config        `yaml:"zap-config"`
	CallerSkip       int
}

type Logger added in v3.3.1

type Logger interface {
	Debug(args ...any)
	Debugf(template string, args ...any)
	Info(args ...any)
	Infof(template string, args ...any)
	Warn(args ...any)
	Warnf(template string, args ...any)
	Error(args ...any)
	Errorf(template string, args ...any)
	Fatal(args ...any)
	Fatalf(fmt string, args ...any)
}

func GetLogger added in v3.3.1

func GetLogger() Logger

GetLogger gets the loggerF

type OpsLogger added in v3.3.1

type OpsLogger interface {
	Logger
	SetLoggerLevel(level string) bool
}

OpsLogger use for the SetLoggerLevel

type Option added in v3.3.0

type Option func(*Options)

func WithAppender added in v3.3.0

func WithAppender(appender string) Option

func WithFileCompress added in v3.3.0

func WithFileCompress() Option

func WithFileMaxAge added in v3.3.0

func WithFileMaxAge(age int) Option

func WithFileMaxBackups added in v3.3.0

func WithFileMaxBackups(backups int) Option

func WithFileMaxSize added in v3.3.0

func WithFileMaxSize(size int) Option

func WithFileName added in v3.3.0

func WithFileName(name string) Option

func WithFormat added in v3.3.0

func WithFormat(format string) Option

func WithLevel added in v3.3.0

func WithLevel(level string) Option

func WithLogrus added in v3.3.0

func WithLogrus() Option

func WithZap added in v3.3.0

func WithZap() Option

type Options added in v3.3.0

type Options struct {
	Logger *global.LoggerConfig
}

func NewOptions added in v3.3.0

func NewOptions(opts ...Option) *Options

Directories

Path Synopsis
Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus.
Package logger is unified facade provided by Dubbo to work with different logger frameworks, eg, Zapper, Logrus.
zap

Jump to

Keyboard shortcuts

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