mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
Merge branch 'main' of https://github.com/Infisical/infisical
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
backend/node_modules
|
||||||
|
frontend/node_modules
|
||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/Infisical/infisical-merge/packages/util"
|
"github.com/Infisical/infisical-merge/packages/util"
|
||||||
"github.com/denisbrodbeck/machineid"
|
"github.com/denisbrodbeck/machineid"
|
||||||
"github.com/posthog/posthog-go"
|
"github.com/posthog/posthog-go"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var POSTHOG_API_KEY_FOR_CLI string
|
var POSTHOG_API_KEY_FOR_CLI string
|
||||||
@@ -13,11 +14,23 @@ type Telemetry struct {
|
|||||||
posthogClient posthog.Client
|
posthogClient posthog.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NoOpLogger struct{}
|
||||||
|
|
||||||
|
func (NoOpLogger) Logf(format string, args ...interface{}) {
|
||||||
|
log.Debug().Msgf(format, args...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (NoOpLogger) Errorf(format string, args ...interface{}) {
|
||||||
|
log.Debug().Msgf(format, args...)
|
||||||
|
}
|
||||||
|
|
||||||
func NewTelemetry(telemetryIsEnabled bool) *Telemetry {
|
func NewTelemetry(telemetryIsEnabled bool) *Telemetry {
|
||||||
if POSTHOG_API_KEY_FOR_CLI != "" {
|
if POSTHOG_API_KEY_FOR_CLI != "" {
|
||||||
client, _ := posthog.NewWithConfig(
|
client, _ := posthog.NewWithConfig(
|
||||||
POSTHOG_API_KEY_FOR_CLI,
|
POSTHOG_API_KEY_FOR_CLI,
|
||||||
posthog.Config{},
|
posthog.Config{
|
||||||
|
Logger: NoOpLogger{},
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
return &Telemetry{isEnabled: telemetryIsEnabled, posthogClient: client}
|
return &Telemetry{isEnabled: telemetryIsEnabled, posthogClient: client}
|
||||||
|
|||||||
Reference in New Issue
Block a user