debug
This commit is contained in:
parent
54be997e62
commit
113bf70059
32
app/app.go
32
app/app.go
@ -11,7 +11,7 @@ import (
|
||||
"github.com/skeris/appInit"
|
||||
"github.com/themakers/hlog"
|
||||
"go.uber.org/zap"
|
||||
//"go.uber.org/zap/zapcore"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"penahub.gitlab.yandexcloud.net/backend/penahub_common/log_mw"
|
||||
dalBS "penahub.gitlab.yandexcloud.net/backend/quiz/answerer/dal"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/answerer/models"
|
||||
@ -22,8 +22,8 @@ import (
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/middleware"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/utils"
|
||||
//"penahub.gitlab.yandexcloud.net/external/trashlog.git/wrappers/zaptrashlog"
|
||||
//"time"
|
||||
"penahub.gitlab.yandexcloud.net/external/trashlog.git/wrappers/zaptrashlog"
|
||||
"time"
|
||||
)
|
||||
|
||||
type App struct {
|
||||
@ -96,20 +96,20 @@ func New(ctx context.Context, opts interface{}, ver appInit.Version) (appInit.Co
|
||||
}
|
||||
}
|
||||
|
||||
//zapLogger = zapLogger.With(
|
||||
// zap.String("SvcCommit", ver.Commit),
|
||||
// zap.String("SvcVersion", ver.Release),
|
||||
// zap.String("SvcBuildTime", ver.BuildTime),
|
||||
//)
|
||||
zapLogger = zapLogger.With(
|
||||
zap.String("SvcCommit", ver.Commit),
|
||||
zap.String("SvcVersion", ver.Release),
|
||||
zap.String("SvcBuildTime", ver.BuildTime),
|
||||
)
|
||||
|
||||
// clickHouseLogger, err := zaptrashlog.NewCore(ctx, zap.InfoLevel, options.TrashLogHost, ver.Release, ver.Commit, time.Now().Unix())
|
||||
// if err != nil {
|
||||
// panic(err)
|
||||
// }
|
||||
//
|
||||
loggerForHlog := zapLogger//.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
|
||||
// return zapcore.NewTee(core, clickHouseLogger)
|
||||
// }))
|
||||
clickHouseLogger, err := zaptrashlog.NewCore(ctx, zap.InfoLevel, options.TrashLogHost, ver.Release, ver.Commit, time.Now().Unix())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
loggerForHlog := zapLogger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
|
||||
return zapcore.NewTee(core, clickHouseLogger)
|
||||
}))
|
||||
|
||||
loggerHlog := hlog.New(loggerForHlog).Module(options.ModuleLogger)
|
||||
loggerHlog.With(models.AllFields{})
|
||||
|
Loading…
Reference in New Issue
Block a user