5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-29 19:01:50 +00:00

Send PPROF output text to stderr instead of stdout so that it doesn't break -genconf

This commit is contained in:
Neil Alexander 2019-07-20 21:56:53 +01:00
parent 48ad3c5d7f
commit 34ac5c9197
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -35,9 +35,9 @@ func init() {
hostPort := os.Getenv(envVarName) hostPort := os.Getenv(envVarName)
switch { switch {
case hostPort == "": case hostPort == "":
fmt.Printf("DEBUG: %s not set, profiler not started.\n", envVarName) fmt.Fprintf(os.Stderr, "DEBUG: %s not set, profiler not started.\n", envVarName)
default: default:
fmt.Printf("DEBUG: Starting pprof on %s\n", hostPort) fmt.Fprintf(os.Stderr, "DEBUG: Starting pprof on %s\n", hostPort)
go func() { fmt.Println(http.ListenAndServe(hostPort, nil)) }() go func() { fmt.Println(http.ListenAndServe(hostPort, nil)) }()
} }
} }