Merge pull request #15 from BenTheElder/nits

address logging nits
This commit is contained in:
Kubernetes Prow Robot 2022-02-03 17:13:59 -08:00 committed by GitHub
commit 786ae98536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -26,19 +26,19 @@ import (
) )
func main() { func main() {
// klog setup
klog.InitFlags(nil)
flag.Parse()
defer klog.Flush()
// cloud run expects us to listen to HTTP on $PORT // cloud run expects us to listen to HTTP on $PORT
port := os.Getenv("PORT") port := os.Getenv("PORT")
if port == "" { if port == "" {
port = "8080" port = "8080"
} }
// klog setup
klog.InitFlags(nil)
flag.Parse()
defer klog.Flush()
// actually serve traffic // actually serve traffic
klog.V(0).InfoS("listening", "port", port) klog.InfoS("listening", "port", port)
if err := http.ListenAndServe(":"+port, http.HandlerFunc(handler)); err != nil { if err := http.ListenAndServe(":"+port, http.HandlerFunc(handler)); err != nil {
klog.Fatal(err) klog.Fatal(err)
} }