Add log.handle

This commit is contained in:
Unknown 2014-03-14 01:59:07 -04:00
parent 15f8bc417e
commit 1ce17cce76
6 changed files with 16 additions and 36 deletions

View file

@ -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)
}