Skip to content

Commit b7ddd44

Browse files
joeybloggsjoeybloggs
authored andcommitted
Add remaining log entry values.
1 parent f4dc6f0 commit b7ddd44

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

handlers/email/email.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ type FormatFunc func() Formatter
2121
type Formatter func(e *log.Entry) *gomail.Message
2222

2323
const (
24-
space = byte(' ')
25-
equals = byte('=')
26-
colon = byte(':')
27-
base10 = 10
28-
v = "%v"
2924
gopath = "GOPATH"
3025
contentType = "text/html"
3126
defaultTemplate = `<!DOCTYPE html>
3227
<html>
3328
<body>
3429
<h2>{{ .Message }}</h2>
30+
{{ if ne .ApplicationID "" }}
31+
<h4>{{ .ApplicationID }}</h4>
32+
{{ end }}
33+
<p>{{ .Level.String }}</p>
34+
<p>{{ ts . }}</p>
3535
{{ if ne .Line 0 }}
3636
{{ display_file . }}:{{ .Line }}
3737
{{ end }}
@@ -161,6 +161,10 @@ func (email *Email) Run() chan<- *log.Entry {
161161
}
162162
return
163163
},
164+
"ts": func(e *log.Entry) (ts string) {
165+
ts = e.Timestamp.Format(email.timestampFormat)
166+
return
167+
},
164168
},
165169
).Parse(email.templateHTML))
166170

0 commit comments

Comments
 (0)