🎨 配置优化
This commit is contained in:
parent
52e9be31c3
commit
3ea919e06c
10
config.go
10
config.go
@ -2,16 +2,16 @@ package logger
|
||||
|
||||
import "fmt"
|
||||
|
||||
type mode int
|
||||
type mode string
|
||||
|
||||
var (
|
||||
Dev mode = 0
|
||||
Prod mode = 1
|
||||
const (
|
||||
Dev mode = "development"
|
||||
Prod mode = "production"
|
||||
)
|
||||
|
||||
// LogConfig 日志配置
|
||||
type LogConfig struct {
|
||||
Mode mode `env:"LOG_MODE"` // dev, prod
|
||||
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地址
|
||||
|
Loading…
Reference in New Issue
Block a user