Add log.handle
This commit is contained in:
parent
15f8bc417e
commit
1ce17cce76
6 changed files with 16 additions and 36 deletions
|
@ -6,6 +6,8 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/martini-contrib/render"
|
||||
|
||||
"github.com/gogits/logs"
|
||||
|
@ -40,8 +42,8 @@ func Critical(format string, v ...interface{}) {
|
|||
logger.Critical(format, v...)
|
||||
}
|
||||
|
||||
func Handle(status int, title, tmpl string, data base.TmplData, r render.Render, err error) {
|
||||
func Handle(status int, title string, data base.TmplData, r render.Render, err error) {
|
||||
data["ErrorMsg"] = err
|
||||
Error("%s: %v", title, err)
|
||||
r.HTML(status, tmpl, data)
|
||||
r.HTML(status, fmt.Sprintf("status/%d", status), data)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue