logger

package
v0.0.0-...-b192f38 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2023 License: AGPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ModuleWeb     = "[WEB]"
	ModuleDb      = "[DB]"
	ModuleSession = "[SESSION]"
	K8s           = "[KUBERNETES]"
	ModuleAPI     = "[API]"
)

nolint

Variables

This section is empty.

Functions

func GetCurrentPath

func GetCurrentPath() string

GetCurrentPath get current path

func GetLogger

func GetLogger(name string) *zap.SugaredLogger

GetLogger - 获取Logger对象

func GetLoggerByChain

func GetLoggerByChain(name, chainId string) *zap.SugaredLogger

GetLoggerByChain - 获取带链标识的Logger对象

func RefreshLogConfig

func RefreshLogConfig(config *LogConf)

RefreshLogConfig refresh log config

func SetLogConfig

func SetLogConfig(config *LogConf)

SetLogConfig - 设置Log配置对象

Types

type LogConf

type LogConf struct {
	LogLevelDefault string            `mapstructure:"log_level_default"`
	LogLevels       map[string]string `mapstructure:"log_levels"`
	FilePath        string            `mapstructure:"file_path"`
	MaxAge          int               `mapstructure:"max_age"`
	RotationTime    int               `mapstructure:"rotation_time"`
	LogInConsole    bool              `mapstructure:"log_in_console"`
	ShowColor       bool              `mapstructure:"show_color"`
}

LogConf 日志配置

func DefaultLogConfig

func DefaultLogConfig() *LogConf

DefaultLogConfig - 获取默认Log配置

func GetDefaultLogNodeConfig

func GetDefaultLogNodeConfig() LogConf

GetDefaultLogNodeConfig get default log node config

Jump to

Keyboard shortcuts

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