This commit is contained in:
Danil Solovyov 2022-03-03 23:04:01 +05:00
parent 4f167a3e3b
commit f4d86e03f3

@ -5,7 +5,9 @@ import (
"context"
"errors"
"fmt"
"github.com/BlackBroker/trashlog/wrappers/zaptg"
"github.com/skeris/appInit"
"go.uber.org/zap/zapcore"
"heruvym/dal/minio"
"heruvym/dal/mongo"
"heruvym/middleware"
@ -33,12 +35,12 @@ const (
)
type Options struct {
MongoURI string `env:"BB_MONGO_URI" default:"mongodb+srv://user_1:cEDxC8ptLMMeoA5m@cluster0.aomle.mongodb.net/"`
MongoURI string `env:"BB_MONGO_URI" default:"mongodb://localhost:27017"`
NumberPortLocal string `env:"BB_PORT" default:"1488"`
LoggerDevMode bool `env:"BB_IS_PROD" default:"false"`
MinioEndpoint string `env:"BB_MINIO_EP" default:"localhost:9000"`
MinioAccessKey string `env:"BB_MINIO_AK" default:"minioadmin"`
MinioSecretKey string `env:"BB_MINIO_SK" default:"minioadmin"`
MinioEndpoint string `env:"BB_MINIO_EP" default:"minio:9001"`
MinioAccessKey string `env:"BB_MINIO_AK" default:"minio"`
MinioSecretKey string `env:"BB_MINIO_SK" default:"miniostorage"`
MinioToken string `env:"BB_MINIO_TOKEN" default:""`
MongoDbTable string `env:"DATABASE_TABLE" default:"profile"`
MongoCollections string `env:"COLLECTION_NAME" default:"profile,role"`
@ -100,22 +102,22 @@ func New(ctx context.Context, opts interface{}) (appInit.CommonApp, error) {
zap.String("SvcBuildTime", version.BuildTime),
)
//tl, err := zaptg.NewCore(
// ctx,
// zap.ErrorLevel,
// "1408111289:AAHfWZRiBQRncb2gl2LtU8OeASjfJi4e8YE",
// version.Release,
// version.Commit,
// 0,
// -1001230000451,
//)
//if err != nil {
// panic(err)
//}
tl, err := zaptg.NewCore(
ctx,
zap.ErrorLevel,
"1408111289:AAHfWZRiBQRncb2gl2LtU8OeASjfJi4e8YE",
version.Release,
version.Commit,
0,
-1001230000451,
)
if err != nil {
panic(err)
}
//zapLogger = zapLogger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
// return zapcore.NewTee(core, tl)
//}))
zapLogger = zapLogger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
return zapcore.NewTee(core, tl)
}))
logger := hlog.New(zapLogger)
logger.Emit(InfoSvcStarted{})