Skip to content
Snippets Groups Projects
Unverified Commit 9ac30a01 authored by Sumner Evans's avatar Sumner Evans
Browse files

treewide: remove some debug logs

parent e7f7f50e
No related branches found
No related tags found
No related merge requests found
......@@ -170,6 +170,13 @@ func (l *LinkedInClient) onUnknownError(ctx context.Context, err error) {
}
func (l *LinkedInClient) onDecoratedEvent(ctx context.Context, decoratedEvent *linkedingo.DecoratedEvent) {
log := zerolog.Ctx(ctx).With().
Str("decorated_event_id", decoratedEvent.ID).
Stringer("topic", decoratedEvent.Topic).
Time("left_server_at", decoratedEvent.LeftServerAt.Time).
Logger()
log.Debug().Msg("Received decorated event")
// The topics are always of the form "urn:li-realtime:TOPIC_NAME:<topic_dependent>"
switch decoratedEvent.Topic.NthPrefixPart(2) {
case linkedingo.RealtimeEventTopicMessages:
......@@ -181,7 +188,7 @@ func (l *LinkedInClient) onDecoratedEvent(ctx context.Context, decoratedEvent *l
case linkedingo.RealtimeEventTopicMessageReactionSummaries:
l.onRealtimeReactionSummaries(ctx, decoratedEvent.Payload.Data.DecoratedReactionSummary.Result)
default:
fmt.Printf("UNSUPPORTED %q %+v\n", decoratedEvent.Topic, decoratedEvent)
log.Warn().Msg("Unsupported event topic")
}
}
......
......@@ -2,7 +2,6 @@ package connector
import (
"context"
"fmt"
"time"
"github.com/rs/zerolog"
......@@ -41,10 +40,7 @@ func (l *LinkedInClient) syncConversations(ctx context.Context) {
return
}
fmt.Printf("%+v\n", conversations)
for _, conv := range conversations.Elements {
fmt.Printf("conv=%+v\n", conv)
if conv.LastActivityAt.Before(updatedBefore) {
updatedBefore = conv.LastActivityAt.Time
}
......
package linkedingo
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
......@@ -211,10 +209,6 @@ func (c *Client) GetMessagesBefore(ctx context.Context, conversationURN URN, bef
return nil, err
}
x, _ := io.ReadAll(resp.Body)
fmt.Printf("%s\n", x)
resp.Body = io.NopCloser(bytes.NewReader(x))
var response GraphQlResponse
return response.Data.MessengerMessagesByAnchorTimestamp, json.NewDecoder(resp.Body).Decode(&response)
}
......
......@@ -269,7 +269,6 @@ func (c *Client) realtimeConnectLoop(ctx context.Context) {
Stringer("topic", realtimeEvent.DecoratedEvent.Topic).
Str("payload_type", realtimeEvent.DecoratedEvent.Payload.Data.Type).
Msg("Received decorated event")
fmt.Printf("%s\n", line)
c.handlers.onDecoratedEvent(ctx, realtimeEvent.DecoratedEvent)
}
}
......
......@@ -7,7 +7,6 @@ import (
"fmt"
"io"
"net/http"
"net/http/httputil"
"net/url"
"strings"
......@@ -99,7 +98,6 @@ func (a *authedRequest) WithCSRF() *authedRequest {
func (a *authedRequest) WithJSONPayload(payload any) *authedRequest {
a.body = bytes.NewReader(exerrors.Must(json.Marshal(payload)))
fmt.Printf("%s\n", exerrors.Must(json.Marshal(payload)))
return a
}
......@@ -162,8 +160,5 @@ func (a *authedRequest) Do(ctx context.Context) (*http.Response, error) {
return nil, fmt.Errorf("failed to perform authed request %s %s: %w", a.method, a.url, err)
}
req.Header = a.header
fmt.Printf("%s\n", exerrors.Must(httputil.DumpRequestOut(req, true)))
return a.client.http.Do(req)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment