Merge pull request #467 from neilalexander/debugtext

Send PPROF output text to stderr
This commit is contained in:
Neil Alexander 2019-07-23 08:15:03 +01:00 committed by GitHub
commit 6263fa287c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)) }()
} }
} }