Remove fmt.Println and add Zerolog logging system
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m2s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m2s
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/viper"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
@@ -185,7 +186,7 @@ func (s MongoDBStorage) CreateAccount(account Account) error {
|
||||
func (s MongoDBStorage) UpdateAccount(account Account) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["users"])
|
||||
if _, err := collection.ReplaceOne(context.TODO(), bson.M{"_id": account.ID}, account); err != nil {
|
||||
fmt.Println(err)
|
||||
log.Error().Err(err).Msg("")
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -193,6 +194,6 @@ func (s MongoDBStorage) UpdateAccount(account Account) error {
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) Migrate() error {
|
||||
fmt.Println("no migration")
|
||||
log.Error().Msg("no migration")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user