Documentation ¶
Index ¶
Constants ¶
View Source
const ( Dev mode = "development" Prod mode = "production" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallerHook ¶ added in v1.0.15
type CallerHook struct{}
CallerHook is a hook designed for dealing with logs in test scenarios.
func NewCallerHook ¶ added in v1.0.15
func NewCallerHook(logger *logrus.Logger) *CallerHook
NewCallerHook installs a test hook for a given local logger.
func (*CallerHook) Levels ¶ added in v1.0.15
func (t *CallerHook) Levels() []logrus.Level
type LogConfig ¶
type LogConfig struct { Mode mode `env:"LOG_MODE" envDefault:"production"` // dev, prod LokiEnable bool `env:"LOG_LOKI_ENABLE"` // 是否启用Loki FileEnable bool `env:"LOG_FILE_ENABLE"` // 是否输出到文件 LokiHost string `env:"LOG_LOKI_HOST"` // Loki地址 LokiPort int `env:"LOG_LOKI_PORT"` // Loki端口 LokiSource string `env:"LOG_LOKI_SOURCE_NAME"` // Loki的source名称 LokiJob string `env:"LOG_LOKI_JOB_NAME"` // Loki的job名称 }
LogConfig 日志配置
Source Files ¶
Click to show internal directories.
Click to hide internal directories.