Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: perf/go/logserver/main.go

Issue 659943006: Do not forget to call `defer glog.Flush()` in our applications (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: revert titletool changes Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « perf/go/ingest/main.go ('k') | perf/go/perf_migratedb/main.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Application that serves up the contents of /tmp/glog via HTTP, giving access 1 // Application that serves up the contents of /tmp/glog via HTTP, giving access
2 // to logs w/o needing to SSH into the server. 2 // to logs w/o needing to SSH into the server.
3 package main 3 package main
4 4
5 import ( 5 import (
6 "flag" 6 "flag"
7 "fmt" 7 "fmt"
8 "html/template" 8 "html/template"
9 "net/http" 9 "net/http"
10 "net/url" 10 "net/url"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 glog.Infof("Dir List: %s", name) 102 glog.Infof("Dir List: %s", name)
103 dirList(w, f) 103 dirList(w, f)
104 return 104 return
105 } 105 }
106 106
107 http.ServeContent(w, r, d.Name(), d.ModTime(), f) 107 http.ServeContent(w, r, d.Name(), d.ModTime(), f)
108 } 108 }
109 109
110 func main() { 110 func main() {
111 flag.Parse() 111 flag.Parse()
112 defer glog.Flush()
112 113
113 if err := os.MkdirAll(*dir, 0777); err != nil { 114 if err := os.MkdirAll(*dir, 0777); err != nil {
114 glog.Fatalf("Failed to create dir for log files: %s", err) 115 glog.Fatalf("Failed to create dir for log files: %s", err)
115 } 116 }
116 117
117 flags.Log() 118 flags.Log()
118 119
119 http.Handle("/", http.StripPrefix("/", FileServer(http.Dir(*dir)))) 120 http.Handle("/", http.StripPrefix("/", FileServer(http.Dir(*dir))))
120 glog.Fatal(http.ListenAndServe(*port, nil)) 121 glog.Fatal(http.ListenAndServe(*port, nil))
121 } 122 }
OLDNEW
« no previous file with comments | « perf/go/ingest/main.go ('k') | perf/go/perf_migratedb/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698