diff options
Diffstat (limited to 'app/diagnostics.go')
-rw-r--r-- | app/diagnostics.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/diagnostics.go b/app/diagnostics.go index d3eee29c5..2c8211f42 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -4,6 +4,8 @@ package app import ( + "log" + "os" "runtime" "github.com/mattermost/platform/model" @@ -44,7 +46,7 @@ var client *analytics.Client func SendDailyDiagnostics() { if *utils.Cfg.LogSettings.EnableDiagnostics { - initDiagnostics() + initDiagnostics("") trackActivity() trackConfig() trackLicense() @@ -52,9 +54,16 @@ func SendDailyDiagnostics() { } } -func initDiagnostics() { +func initDiagnostics(endpoint string) { if client == nil { client = analytics.New(SEGMENT_KEY) + // For testing + if endpoint != "" { + client.Endpoint = endpoint + client.Verbose = true + client.Size = 1 + client.Logger = log.New(os.Stdout, "segment ", log.LstdFlags) + } client.Identify(&analytics.Identify{ UserId: utils.CfgDiagnosticId, }) |