Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ea4d182 authored by Nicolas Melin's avatar Nicolas Melin Committed by root
Browse files

Add env variable for Sentry environment

parent 3ab62cd9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
| STREAM_SDID                          | stream@12345             | No                                                   | Stream SD ID for stream logs                                                    |
| PORT                                 | 888                      | No                                                   | The port used by quic protocol                                                  |
| SENTRY_DSN                           | -                        | Yes                                                  | DSN for Sentry                                                                  |
| SENTRY_ENVIRONMENT                   | -                        | Yes                                                  | Environment for Sentry                                                          |

# Stream logs

+7 −0
Original line number Diff line number Diff line
@@ -18,8 +18,15 @@ func Init() (func(), error) {
		return nil, errors.New(errorMessage)
	}
	
	environment := os.Getenv("SENTRY_ENVIRONMENT")
	if(environment == "") {
		errorMessage := "Env SENTRY_ENVIRONMENT is not set !"
		return nil, errors.New(errorMessage)
	}

    err := sentry.Init(sentry.ClientOptions{
        Dsn: dsn,
        Environment: environment,
    })
    if err != nil {
		errorMessage := fmt.Sprintf("sentry.Init: %s", err)