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" "context"
"errors" "errors"
"fmt" "fmt"
"github.com/BlackBroker/trashlog/wrappers/zaptg"
"github.com/skeris/appInit" "github.com/skeris/appInit"
"go.uber.org/zap/zapcore"
"heruvym/dal/minio" "heruvym/dal/minio"
"heruvym/dal/mongo" "heruvym/dal/mongo"
"heruvym/middleware" "heruvym/middleware"
@ -33,12 +35,12 @@ const (
) )
type Options struct { 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"` NumberPortLocal string `env:"BB_PORT" default:"1488"`
LoggerDevMode bool `env:"BB_IS_PROD" default:"false"` LoggerDevMode bool `env:"BB_IS_PROD" default:"false"`
MinioEndpoint string `env:"BB_MINIO_EP" default:"localhost:9000"` MinioEndpoint string `env:"BB_MINIO_EP" default:"minio:9001"`
MinioAccessKey string `env:"BB_MINIO_AK" default:"minioadmin"` MinioAccessKey string `env:"BB_MINIO_AK" default:"minio"`
MinioSecretKey string `env:"BB_MINIO_SK" default:"minioadmin"` MinioSecretKey string `env:"BB_MINIO_SK" default:"miniostorage"`
MinioToken string `env:"BB_MINIO_TOKEN" default:""` MinioToken string `env:"BB_MINIO_TOKEN" default:""`
MongoDbTable string `env:"DATABASE_TABLE" default:"profile"` MongoDbTable string `env:"DATABASE_TABLE" default:"profile"`
MongoCollections string `env:"COLLECTION_NAME" default:"profile,role"` 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), zap.String("SvcBuildTime", version.BuildTime),
) )
//tl, err := zaptg.NewCore( tl, err := zaptg.NewCore(
// ctx, ctx,
// zap.ErrorLevel, zap.ErrorLevel,
// "1408111289:AAHfWZRiBQRncb2gl2LtU8OeASjfJi4e8YE", "1408111289:AAHfWZRiBQRncb2gl2LtU8OeASjfJi4e8YE",
// version.Release, version.Release,
// version.Commit, version.Commit,
// 0, 0,
// -1001230000451, -1001230000451,
//) )
//if err != nil { if err != nil {
// panic(err) panic(err)
//} }
//zapLogger = zapLogger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core { zapLogger = zapLogger.WithOptions(zap.WrapCore(func(core zapcore.Core) zapcore.Core {
// return zapcore.NewTee(core, tl) return zapcore.NewTee(core, tl)
//})) }))
logger := hlog.New(zapLogger) logger := hlog.New(zapLogger)
logger.Emit(InfoSvcStarted{}) logger.Emit(InfoSvcStarted{})