2
0
mirror of https://gitee.ltd/lxh/logger.git synced 2026-02-02 06:53:39 +00:00

🎉 创建项目

This commit is contained in:
李寻欢
2021-12-14 10:53:50 +08:00
commit 44f3ff15a1
10 changed files with 1440 additions and 0 deletions

24
config.go Normal file
View 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)
}