🧪 Add more debug logs
This commit is contained in:
parent
37f10e708e
commit
42c3770231
@ -42,6 +42,8 @@ func main() {
|
|||||||
// All the things are optional so when error occurred the server won't crash
|
// All the things are optional so when error occurred the server won't crash
|
||||||
if err := external.SetupFirebase(viper.GetString("external.firebase.credentials")); err != nil {
|
if err := external.SetupFirebase(viper.GetString("external.firebase.credentials")); err != nil {
|
||||||
log.Error().Err(err).Msg("An error occurred when starting firebase communicating...")
|
log.Error().Err(err).Msg("An error occurred when starting firebase communicating...")
|
||||||
|
} else {
|
||||||
|
log.Info().Msg("Successfully setup firebase communication.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Server
|
// Server
|
||||||
|
@ -75,8 +75,13 @@ func NewNotification(
|
|||||||
Token: subscriber.DeviceID,
|
Token: subscriber.DeviceID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err = client.Send(ctx, message); err != nil {
|
if response, err := client.Send(ctx, message); err != nil {
|
||||||
log.Warn().Err(err).Msg("An error occurred when notify subscriber though firebase FCM...")
|
log.Warn().Err(err).Msg("An error occurred when notify subscriber though firebase FCM...")
|
||||||
|
} else {
|
||||||
|
log.Debug().
|
||||||
|
Str("response", response).
|
||||||
|
Int("subscriber", int(subscriber.ID)).
|
||||||
|
Msg("Notified to subscriber though firebase FCM.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user