File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,17 @@ type FormatFunc func() Formatter
2121type Formatter func (e * log.Entry ) * gomail.Message
2222
2323const (
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
You can’t perform that action at this time.
0 commit comments