mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
This will not actually send telemetry data as the database call is hard-coded to always return false. Also configures installation telemetry to be sent periodically in the Installer
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
// Licensed under the GNU Affero General Public License (AGPL).
|
|
// See License-AGPL.txt in the project root for license information.
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"github.com/gitpod-io/gitpod/common-go/log"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
// ServiceName is the name we use for tracing/logging
|
|
ServiceName = "installation-telemetry"
|
|
// Version of this service - set during build
|
|
Version = ""
|
|
)
|
|
|
|
var jsonLog bool
|
|
var verbose bool
|
|
|
|
// rootCmd represents the base command when called without any subcommands
|
|
var rootCmd = &cobra.Command{
|
|
Use: ServiceName,
|
|
Short: "This service sends telemetry information back to Gitpod",
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
log.Init(ServiceName, Version, jsonLog, verbose)
|
|
},
|
|
}
|
|
|
|
func Execute() {
|
|
cobra.CheckErr(rootCmd.Execute())
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.PersistentFlags().BoolVarP(&jsonLog, "json-log", "j", true, "produce JSON log output on verbose level")
|
|
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Enable verbose JSON logging")
|
|
}
|