Explorar el Código

Include GODEBUG value in startup log

Rod Hynes hace 6 años
padre
commit
914069ec6e
Se han modificado 2 ficheros con 5 adiciones y 3 borrados
  1. 2 2
      psiphon/common/buildinfo/buildinfo.go
  2. 3 1
      psiphon/server/services.go

+ 2 - 2
psiphon/common/buildinfo/buildinfo.go

@@ -65,7 +65,7 @@ type BuildInfo struct {
 }
 
 // ToMap converts 'BuildInfo' struct to 'map[string]interface{}'
-func (bi *BuildInfo) ToMap() *map[string]interface{} {
+func (bi *BuildInfo) ToMap() map[string]interface{} {
 
 	var dependenciesMap map[string]interface{}
 	json.Unmarshal([]byte(bi.Dependencies), &dependenciesMap)
@@ -79,7 +79,7 @@ func (bi *BuildInfo) ToMap() *map[string]interface{} {
 		"valuesRev":    bi.ValuesRev,
 	}
 
-	return &buildInfoMap
+	return buildInfoMap
 }
 
 // GetBuildInfo returns an instance of the BuildInfo struct

+ 3 - 1
psiphon/server/services.go

@@ -68,7 +68,9 @@ func RunServices(configJSON []byte) error {
 		return errors.Trace(err)
 	}
 
-	log.WithTraceFields(*buildinfo.GetBuildInfo().ToMap()).Info("startup")
+	startupFields := buildinfo.GetBuildInfo().ToMap()
+	startupFields["GODEBUG"] = os.Getenv("GODEBUG")
+	log.WithTraceFields(startupFields).Info("startup")
 
 	waitGroup := new(sync.WaitGroup)
 	shutdownBroadcast := make(chan struct{})