- update log

master
李光春 2 years ago
parent 90c4620e6e
commit 603670beed

@ -51,7 +51,7 @@ func NewClient(config *ClientConfig) (*Client, error) {
c.requestClient = gorequest.NewHttp()
gormClient := config.GormClientFun()
if gormClient.Db != nil {
if gormClient != nil && gormClient.Db != nil {
c.log.logGormClient, err = golog.NewApiGormClient(func() (*dorm.GormClient, string) {
return gormClient, logTable
}, config.Debug)
@ -59,11 +59,11 @@ func NewClient(config *ClientConfig) (*Client, error) {
return nil, err
}
c.log.gorm = true
c.log.gormClient = gormClient
}
c.log.gormClient = gormClient
mongoClient, databaseName := config.MongoClientFun()
if mongoClient.Db != nil {
if mongoClient != nil && mongoClient.Db != nil {
c.log.logMongoClient, err = golog.NewApiMongoClient(func() (*dorm.MongoClient, string, string) {
return mongoClient, databaseName, logTable
}, config.Debug)
@ -71,8 +71,8 @@ func NewClient(config *ClientConfig) (*Client, error) {
return nil, err
}
c.log.mongo = true
c.log.mongoClient = mongoClient
}
c.log.mongoClient = mongoClient
return c, nil
}

@ -8,4 +8,4 @@ const (
logTable = "meituan"
)
const Version = "1.0.12"
const Version = "1.0.13"

Loading…
Cancel
Save