logger

package
v0.0.0-...-fe3505f Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug is debug level

func Debugf

func Debugf(fmt string, args ...interface{})

Debugf is format debug level

func Error

func Error(args ...interface{})

Error is error level

func Errorf

func Errorf(fmt string, args ...interface{})

Errorf is format error level

func Info

func Info(args ...interface{})

Info is info level

func Infof

func Infof(fmt string, args ...interface{})

Infof is format info level

func InitLogger

func InitLogger(config Config) (err error)

InitLogger is init global logger for xgrpc

func SetLogger

func SetLogger(log Logger)

SetLogger sets logger for sdk

func Warn

func Warn(args ...interface{})

Warn is warning level

func Warnf

func Warnf(fmt string, args ...interface{})

Warnf is format warning level

Types

type Config

type Config struct {
	Level            string
	Sampling         *SamplingConfig
	AppendToStdout   bool
	LogRollingConfig *lumberjack.Logger
}

func BuildLoggerConfig

func BuildLoggerConfig(clientConfig constant.ClientConfig) Config

type Logger

type Logger interface {
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Debug(args ...interface{})

	Infof(fmt string, args ...interface{})
	Warnf(fmt string, args ...interface{})
	Errorf(fmt string, args ...interface{})
	Debugf(fmt string, args ...interface{})
}

Logger is the interface for Logger types

func GetLogger

func GetLogger() Logger

func InitXgrpcLogger

func InitXgrpcLogger(config Config) (Logger, error)

InitXgrpcLogger is init xgrpc default logger

type SamplingConfig

type SamplingConfig struct {
	Initial    int
	Thereafter int
	Tick       time.Duration
}

type XgrpcLogger

type XgrpcLogger struct {
	Logger
}

Jump to

Keyboard shortcuts

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