loggerutil

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(loggerManager LoggerManager) (log.Logger, error)

func GetLoggerForHelper

func GetLoggerForHelper(loggerManager LoggerManager) (log.Logger, error)

func GetLoggerForMiddleware

func GetLoggerForMiddleware(loggerManager LoggerManager) (log.Logger, error)

func GetWriter

func GetWriter(loggerManager LoggerManager) (io.Writer, error)

Types

type LoggerManager

type LoggerManager interface {
	EnableConsole() bool
	EnableFile() bool
	GetWriter() (io.Writer, error)
	GetLogger() (log.Logger, error)
	GetLoggerForMiddleware() (log.Logger, error)
	GetLoggerForHelper() (log.Logger, error)
	Close() error
}

func NewLoggerManager

func NewLoggerManager(conf *configpb.Log, appConfig *configpb.App) (LoggerManager, error)

func NewSingletonLoggerManager

func NewSingletonLoggerManager(conf *configpb.Log, appConfig *configpb.App) (LoggerManager, error)

type Loggers

type Loggers struct {
	Logger              log.Logger
	LoggerForMiddleware log.Logger
	LoggerForHelper     log.Logger
}

type ServiceInfo

type ServiceInfo struct {
	Project  string `json:"project"`
	Name     string `json:"name"`
	Env      string `json:"env"`
	Version  string `json:"version"`
	Hostname string `json:"hostname"`
	IP       string `json:"ip"`
}

func NewServiceInfo

func NewServiceInfo(appConfig *configpb.App) *ServiceInfo

func (*ServiceInfo) Kvs

func (s *ServiceInfo) Kvs() []interface{}

type TracerInfo

type TracerInfo struct {
	Tracer log.Valuer
}

func NewTracerInfo

func NewTracerInfo() *TracerInfo

func (*TracerInfo) Kvs

func (s *TracerInfo) Kvs() []interface{}

Jump to

Keyboard shortcuts

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