Replace standard log with logrus import
This commit is contained in:
@@ -16,10 +16,10 @@ package dent
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
"log"
|
||||
)
|
||||
|
||||
type DentRepository struct {
|
||||
@@ -32,9 +32,9 @@ func (repository DentRepository) Create(headerID int64, models []interface{}) er
|
||||
return dBaseErr
|
||||
}
|
||||
|
||||
tic, gettTicErr := shared.GetTicInTx(headerID, tx)
|
||||
if gettTicErr != nil {
|
||||
return gettTicErr
|
||||
tic, getTicErr := shared.GetTicInTx(headerID, tx)
|
||||
if getTicErr != nil {
|
||||
return getTicErr
|
||||
}
|
||||
|
||||
for _, model := range models {
|
||||
@@ -42,7 +42,7 @@ func (repository DentRepository) Create(headerID int64, models []interface{}) er
|
||||
if !ok {
|
||||
rollbackErr := tx.Rollback()
|
||||
if rollbackErr != nil {
|
||||
log.Println("failed to rollback ", rollbackErr)
|
||||
log.Error("failed to rollback ", rollbackErr)
|
||||
}
|
||||
return fmt.Errorf("model of type %T, not %T", model, DentModel{})
|
||||
}
|
||||
@@ -55,7 +55,7 @@ func (repository DentRepository) Create(headerID int64, models []interface{}) er
|
||||
if execErr != nil {
|
||||
rollbackErr := tx.Rollback()
|
||||
if rollbackErr != nil {
|
||||
log.Println("failed to rollback ", rollbackErr)
|
||||
log.Error("failed to rollback ", rollbackErr)
|
||||
}
|
||||
return execErr
|
||||
}
|
||||
@@ -65,7 +65,7 @@ func (repository DentRepository) Create(headerID int64, models []interface{}) er
|
||||
if checkHeaderErr != nil {
|
||||
rollbackErr := tx.Rollback()
|
||||
if rollbackErr != nil {
|
||||
log.Println("failed to rollback ", rollbackErr)
|
||||
log.Error("failed to rollback ", rollbackErr)
|
||||
}
|
||||
return checkHeaderErr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user