common.go
594 字节
package constant
import (
"fmt"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
)
var (
LogFilePath string = "F:/log/app.log"
LogLevel string = "error"
RunMode string = "dev"
)
func init() {
LogLevel = config.StringDefault("log_level", LogLevel)
LogFilePath = config.StringDefault("aliyun_logs_access", LogFilePath)
RunMode = config.StringDefault("RUN_MODE", RunMode)
}
func DebugConfig() {
for i := range config.HistorySort {
k := config.HistorySort[i]
v, ok := config.History[k]
if !ok {
continue
}
log.Debug(fmt.Sprintf("【load config】 %v=%v", k, v))
}
}