Replace standard log with logrus import

This commit is contained in:
Andrew J Yao
2019-01-11 10:07:00 -08:00
committed by yaoandrew
parent bc8b7a101c
commit c8aa3dc275
28 changed files with 112 additions and 112 deletions
+7 -7
View File
@@ -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
}