change: group environments

This commit is contained in:
debugtalk
2022-10-11 11:12:28 +08:00
parent a8aab0e905
commit c81c5841ee
8 changed files with 33 additions and 19 deletions
+3 -3
View File
@@ -2,13 +2,13 @@ package sdk
import (
"fmt"
"os"
"github.com/denisbrodbeck/machineid"
"github.com/getsentry/sentry-go"
"github.com/google/uuid"
"github.com/rs/zerolog/log"
"github.com/httprunner/httprunner/v4/hrp/internal/env"
"github.com/httprunner/httprunner/v4/hrp/internal/version"
)
@@ -29,7 +29,7 @@ func init() {
gaClient = NewGAClient(trackingID, clientID)
// init sentry sdk
if os.Getenv("DISABLE_SENTRY") == "true" {
if env.DISABLE_SENTRY == "true" {
return
}
err = sentry.Init(sentry.ClientOptions{
@@ -50,7 +50,7 @@ func init() {
}
func SendEvent(e IEvent) error {
if os.Getenv("DISABLE_GA") == "true" {
if env.DISABLE_GA == "true" {
// do not send GA events in CI environment
return nil
}