mirror of
https://gitee.ltd/lxh/logger.git
synced 2026-02-02 06:53:39 +00:00
🎉 创建项目
This commit is contained in:
24
config.go
Normal file
24
config.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package logger
|
||||
|
||||
import "fmt"
|
||||
|
||||
type mode int
|
||||
|
||||
var (
|
||||
Dev mode = 0
|
||||
Prod mode = 1
|
||||
)
|
||||
|
||||
// LogConfig 日志配置
|
||||
type LogConfig struct {
|
||||
Mode mode // dev, prod
|
||||
LokiEnable bool
|
||||
FileEnable bool
|
||||
LokiHost string
|
||||
LokiPort int
|
||||
LokiName string // Loki的job和source名称
|
||||
}
|
||||
|
||||
func (c LogConfig) getLokiPushURL() string {
|
||||
return fmt.Sprintf("http://%v:%v/loki/api/v1/push", c.LokiHost, c.LokiPort)
|
||||
}
|
||||
Reference in New Issue
Block a user