Skip to content

Commit

Permalink
fix: silence telemetry errors
Browse files Browse the repository at this point in the history
Closes #192
  • Loading branch information
palkan committed Sep 28, 2023
1 parent d1108c9 commit bba0225
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ type Tracker struct {
observations map[string]interface{}
}

type noopLogger struct{}

func (l noopLogger) Logf(format string, args ...interface{}) {}
func (l noopLogger) Errorf(format string, args ...interface{}) {}

func NewTracker(instrumenter *metrics.Metrics, c *config.Config, tc *Config) *Tracker {
client, _ := posthog.NewWithConfig(tc.Token, posthog.Config{Endpoint: tc.Endpoint})
client, _ := posthog.NewWithConfig(tc.Token, posthog.Config{
Endpoint: tc.Endpoint,
// set to no-op to avoid logging
Logger: noopLogger{},
})

id, _ := nanoid.Nanoid(8)

Expand Down

0 comments on commit bba0225

Please sign in to comment.