Skip to content

Commit

Permalink
Merge pull request #105 from getAlby/task-debug
Browse files Browse the repository at this point in the history
chore: move logs to debug level
  • Loading branch information
bumi authored Aug 20, 2024
2 parents 2a8faae + 28ce366 commit f73fec3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/nostr/nostr.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Config struct {
DatabaseMaxConns int `envconfig:"DATABASE_MAX_CONNS" default:"10"`
DatabaseMaxIdleConns int `envconfig:"DATABASE_MAX_IDLE_CONNS" default:"5"`
DatabaseConnMaxLifetime int `envconfig:"DATABASE_CONN_MAX_LIFETIME" default:"1800"` // 30 minutes
LogLevel int `envconfig:"LOG_LEVEL" default:"4"`
Port int `envconfig:"PORT" default:"8081"`
}

Expand Down Expand Up @@ -63,7 +64,7 @@ func NewService(ctx context.Context) (*Service, error) {
logger := logrus.New()
logger.SetFormatter(&logrus.JSONFormatter{})
logger.SetOutput(os.Stdout)
logger.SetLevel(logrus.InfoLevel)
logger.SetLevel(logrus.Level(cfg.LogLevel))

var db *gorm.DB
var sqlDb *sql.DB
Expand Down Expand Up @@ -787,7 +788,7 @@ func (svc *Service) publishRequestEvent(ctx context.Context, subscription *Subsc
"relay_url": subscription.RelayUrl,
"wallet_pubkey": walletPubkey,
"client_pubkey": clientPubkey,
}).Info("Published request event")
}).Debug("Published request event")
subscription.RequestEvent.State = REQUEST_EVENT_PUBLISH_CONFIRMED
}
svc.db.Save(&subscription.RequestEvent)
Expand All @@ -802,7 +803,7 @@ func (svc *Service) handleResponseEvent(event *nostr.Event, subscription *Subscr
"wallet_pubkey": walletPubkey,
"client_pubkey": clientPubkey,
"relay_url": subscription.RelayUrl,
}).Info("Received response event")
}).Debug("Received response event")

subscription.RequestEvent.ResponseReceivedAt = time.Now()
svc.db.Save(&subscription.RequestEvent)
Expand Down

0 comments on commit f73fec3

Please sign in to comment.