修改错误变量名

master
ymm 2021-12-22 10:59:05 +08:00
parent 8925945571
commit 42beeb1c06
3 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
log/2021-11-18.log log/2021-12-22.log

View File

@ -1,6 +1,6 @@
package utils package utils
const ( const (
ConfigEnv = "GVA_CONFIG" ConfigEnv = "GLOBAL_CONFIG"
ConfigFile = "config.yaml" ConfigFile = "config.yaml"
) )

View File

@ -5,9 +5,9 @@ import (
"path" "path"
"time" "time"
"goweb-gin-demo/global"
zaprotatelogs "github.com/lestrrat-go/file-rotatelogs" zaprotatelogs "github.com/lestrrat-go/file-rotatelogs"
"go.uber.org/zap/zapcore" "go.uber.org/zap/zapcore"
"goweb-gin-demo/global"
) )
//@author: [SliverHorn](https://github.com/SliverHorn) //@author: [SliverHorn](https://github.com/SliverHorn)
@ -17,7 +17,7 @@ import (
func GetWriteSyncer() (zapcore.WriteSyncer, error) { func GetWriteSyncer() (zapcore.WriteSyncer, error) {
fileWriter, err := zaprotatelogs.New( fileWriter, err := zaprotatelogs.New(
path.Join(global.GVA_CONFIG.Zap.Director, "%Y-%m-%d.log"), path.Join(global.GLOBAL_CONFIG.Zap.Director, "%Y-%m-%d.log"),
zaprotatelogs.WithMaxAge(7*24*time.Hour), zaprotatelogs.WithMaxAge(7*24*time.Hour),
zaprotatelogs.WithRotationTime(24*time.Hour), zaprotatelogs.WithRotationTime(24*time.Hour),
) )