Skip to content

Commit

Permalink
remove old logging
Browse files Browse the repository at this point in the history
  • Loading branch information
HermanPlay committed Dec 26, 2024
1 parent fd8696d commit 659482a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 18 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.23.2
require (
github.com/google/uuid v1.6.0
github.com/rabbitmq/amqp091-go v1.10.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.9.0
github.com/swaggo/swag v1.16.4
go.uber.org/zap v1.27.0
Expand Down Expand Up @@ -39,7 +38,6 @@ require (
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/joho/godotenv v1.5.1
golang.org/x/sys v0.27.0 // indirect
golang.org/x/text v0.20.0 // indirect
gorm.io/driver/postgres v1.5.9
gorm.io/gorm v1.25.12
Expand Down
5 changes: 0 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzuk
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand All @@ -62,9 +60,6 @@ golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
Expand Down
3 changes: 1 addition & 2 deletions internal/api/http/initialization/initialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/mini-maxit/backend/package/repository"
"github.com/mini-maxit/backend/package/service"
"github.com/mini-maxit/backend/package/utils"
"github.com/sirupsen/logrus"

amqp "github.com/rabbitmq/amqp091-go"
)
Expand Down Expand Up @@ -46,7 +45,7 @@ func connectToBroker(cfg *config.Config) (*amqp.Connection, *amqp.Channel) {
continue
}
}
logrus.Printf("Connected to RabbitMQ")
log.Infof("Connected to RabbitMQ")

if err != nil {
log.Panicf("Failed to connect to RabbitMQ: %s", err.Error())
Expand Down
2 changes: 0 additions & 2 deletions internal/api/http/routes/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/mini-maxit/backend/internal/api/http/utils"
"github.com/mini-maxit/backend/internal/database"
"github.com/mini-maxit/backend/package/service"
"github.com/sirupsen/logrus"
)

type SessionRoute interface {
Expand Down Expand Up @@ -97,7 +96,6 @@ func (sr *SessionRouteImpl) ValidateSession(w http.ResponseWriter, r *http.Reque

func (sr *SessionRouteImpl) InvalidateSession(w http.ResponseWriter, r *http.Request) {
sessionToken := r.Header.Get("Session")
logrus.Info("Invalidate session token: ", sessionToken)
if sessionToken == "" {
utils.ReturnError(w, http.StatusUnauthorized, "Session token is empty")
return
Expand Down
3 changes: 0 additions & 3 deletions internal/api/http/routes/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/mini-maxit/backend/internal/database"
"github.com/mini-maxit/backend/package/domain/schemas"
"github.com/mini-maxit/backend/package/service"
"github.com/sirupsen/logrus"
)

type TaskRoute interface {
Expand Down Expand Up @@ -52,13 +51,11 @@ func (tr *TaskRouteImpl) GetAllTasks(w http.ResponseWriter, r *http.Request) {

query := r.URL.Query()
limitStr := query.Get("limit")
logrus.Info(limitStr)
if limitStr == "" {
limitStr = utils.DefaultPaginationLimitStr
}

offsetStr := query.Get("offset")
logrus.Info(offsetStr)
if offsetStr == "" {
offsetStr = utils.DefaultPaginationOffsetStr
}
Expand Down
3 changes: 1 addition & 2 deletions internal/database/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (

"github.com/mini-maxit/backend/internal/config"
"github.com/mini-maxit/backend/internal/logger"
"github.com/sirupsen/logrus"
"go.uber.org/zap"
"gorm.io/driver/postgres"
"gorm.io/gorm"
Expand Down Expand Up @@ -36,7 +35,7 @@ func (p *PostgresDB) Connect() (*gorm.DB, error) {
}
tx := p.Db.Begin()
if tx.Error != nil {
logrus.Errorf("Failed to start transaction: %s", tx.Error.Error())
p.logger.Errorf("Failed to start transaction: %s", tx.Error.Error())
return nil, tx.Error
}
p.tx = tx
Expand Down
2 changes: 0 additions & 2 deletions internal/testutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/mini-maxit/backend/internal/config"
"github.com/mini-maxit/backend/internal/database"
"github.com/sirupsen/logrus"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
Expand Down Expand Up @@ -36,7 +35,6 @@ func NewTestConfig() *config.Config {

func NewTestPostgresDB(cfg *config.Config) (database.Database, error) {
databaseUrl := fmt.Sprintf("host=%s port=%d user=%s dbname=%s password=%s sslmode=disable", cfg.DB.Host, cfg.DB.Port, cfg.DB.User, config.TEST_DB_NAME, cfg.DB.Password)
logrus.Infof("Connecting to the database: %s", databaseUrl)
db, err := gorm.Open(postgres.Open(databaseUrl), &gorm.Config{})
if err != nil {
return nil, err
Expand Down

0 comments on commit 659482a

Please sign in to comment.