Remove fmt.Println and add Zerolog logging system
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 1m2s

This commit is contained in:
2024-11-11 20:35:17 +01:00
parent 4ae6aa7a90
commit 5e4cea0bb3
11 changed files with 88 additions and 55 deletions

View File

@@ -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
}