mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-09 13:35:15 +00:00
refactor: Replace fmt.Printf with structured logging using logrus in api-server subscriber and invoice services
- Add logrus import to invoice.go, subscriber_crud.go, subscriber_esim.go, and subscriber_lifecycle.go - Replace fmt.Printf with logrus.WithError and WithField for structured error logging - Update invoice email notification placeholder to use logrus.Info with invoice_id field - Replace eSIM provisioning error print with logrus.Warn including subscriber_id field - Add comment explaining derived
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/nutcas3/telecom-platform/apps/api-server/internal/models"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// SuspendSubscriber suspends a subscriber and terminates their sessions.
|
||||
@@ -124,7 +125,7 @@ func (s *SubscriberService) terminateSubscriberSessions(ctx context.Context, ims
|
||||
}
|
||||
|
||||
if err := s.amfClient.TerminateSession(ctx, imsi, "Subscriber terminated"); err != nil {
|
||||
fmt.Printf("Failed to notify AMF for session termination: %v\n", err)
|
||||
logrus.WithError(err).WithField("imsi", imsi).Warn("Failed to notify AMF for session termination")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user