logger

package
v0.0.0-...-b5678d6 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppLogger

func NewAppLogger(cfg Config) *appLogger

NewAppLogger creates new logger.

Types

type Config

type Config struct {
	LogLevel string `yaml:"log_level" env:"LOG_LEVEL" env-default:"info"`
	Console  bool   `yaml:"console" env:"LOG_CONSOLE" env-default:"true"`
}

Config is a logger config.

type Logger

type Logger interface {
	InitLogger()
	Debugf(template string, args ...interface{})
	Infof(template string, args ...interface{})
	Warnf(template string, args ...interface{})
	Errorf(template string, args ...interface{})
	DPanicf(template string, args ...interface{})
	Fatalf(template string, args ...interface{})
	Printf(template string, args ...interface{})
	Fatal(args ...interface{})
	Named(name string)
	GrpcMiddlewareAccessLogger(method string, time time.Duration, metaData map[string][]string, err error)
	GrpcClientInterceptorLogger(method string, req interface{}, reply interface{}, time time.Duration, metaData map[string][]string, err error)
}

Logger interface.

Jump to

Keyboard shortcuts

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