infra: add logging wrapping
Resolves issues with gcp cloud logging quirks such as field names
This commit is contained in:
@@ -3,7 +3,8 @@ package pusher
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
|
||||
"github.com/flowy-live/llink/internal/utils/flog"
|
||||
)
|
||||
|
||||
type subscribeRequest struct {
|
||||
@@ -110,7 +111,7 @@ func (h *Hub) handleSubscribe(ctx context.Context, req *subscribeRequest) {
|
||||
|
||||
presence, err := h.bridge.Subscribe(ctx, req.channelID, req.conn.id, req.conn.humanID)
|
||||
if err != nil {
|
||||
slog.Error("redis subscribe failed", "channelId", req.channelID, "error", err)
|
||||
flog.Error("redis subscribe failed", "channelId", req.channelID, "error", err)
|
||||
// Fall back to local-only presence.
|
||||
presence = ch.localHumanIDs()
|
||||
}
|
||||
@@ -144,7 +145,7 @@ func (h *Hub) handleUnsubscribe(ctx context.Context, req *unsubscribeRequest) {
|
||||
}
|
||||
|
||||
if err := h.bridge.Unsubscribe(ctx, req.channelID, req.conn.id, req.conn.humanID); err != nil {
|
||||
slog.Error("redis unsubscribe failed", "channelId", req.channelID, "error", err)
|
||||
flog.Error("redis unsubscribe failed", "channelId", req.channelID, "error", err)
|
||||
}
|
||||
|
||||
// Only emit leave once the humanID has no remaining tabs on this pod.
|
||||
@@ -198,7 +199,7 @@ func (h *Hub) handleDisconnect(ctx context.Context, conn *Conn) {
|
||||
ch.removeMember(conn)
|
||||
|
||||
if err := h.bridge.Unsubscribe(ctx, channelID, conn.id, conn.humanID); err != nil {
|
||||
slog.Error("redis unsubscribe on disconnect failed", "channelId", channelID, "error", err)
|
||||
flog.Error("redis unsubscribe on disconnect failed", "channelId", channelID, "error", err)
|
||||
}
|
||||
|
||||
if !ch.hasHumanID(conn.humanID) {
|
||||
|
||||
Reference in New Issue
Block a user