diff options
| author | Christine Dodrill <me@christine.website> | 2017-12-13 10:49:13 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2017-12-13 11:42:37 -0800 |
| commit | 9003cd5b93421e2942531464ccc07fdd129cf252 (patch) | |
| tree | 053dae2d7d94b77c1d0405234e845f268c3a9f5b /html.go | |
| parent | 3a21ef192628f6952eaa981bcdf718a35a4b43c7 (diff) | |
| download | xesite-9003cd5b93421e2942531464ccc07fdd129cf252.tar.xz xesite-9003cd5b93421e2942531464ccc07fdd129cf252.zip | |
fix build
Diffstat (limited to 'html.go')
| -rw-r--r-- | html.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,6 +1,7 @@ package main import ( + "context" "fmt" "html/template" "net/http" @@ -11,7 +12,7 @@ import ( func logTemplateTime(name string, from time.Time) { now := time.Now() - ln.Log(ln.F{"action": "template_rendered", "dur": now.Sub(from).String(), "name": name}) + ln.Log(context.Background(), ln.F{"action": "template_rendered", "dur": now.Sub(from).String(), "name": name}) } func (s *Site) renderTemplatePage(templateFname string, data interface{}) http.Handler { @@ -27,11 +28,11 @@ func (s *Site) renderTemplatePage(templateFname string, data interface{}) http.H t, err = template.ParseFiles("templates/base.html", "templates/"+templateFname) if err != nil { w.WriteHeader(http.StatusInternalServerError) - ln.Error(err, ln.F{"action": "renderTemplatePage", "page": templateFname}) + ln.Error(context.Background(), err, ln.F{"action": "renderTemplatePage", "page": templateFname}) fmt.Fprintf(w, "error: %v", err) } - ln.Log(ln.F{"action": "loaded_new_template", "fname": templateFname}) + ln.Log(context.Background(), ln.F{"action": "loaded_new_template", "fname": templateFname}) s.tlock.RUnlock() s.tlock.Lock() |
