1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

Update to 4.1.7. Logger changes, read HISTORY.md

This commit is contained in:
Gerasimos Maropoulos
2016-09-07 07:36:23 +03:00
parent eacc04406a
commit 1a7c79db66
9 changed files with 147 additions and 82 deletions

View File

@@ -568,7 +568,9 @@ func (ctx *Context) Render(name string, binding interface{}, options ...map[stri
func (ctx *Context) MustRender(name string, binding interface{}, options ...map[string]interface{}) {
if err := ctx.Render(name, binding, options...); err != nil {
ctx.Panic()
ctx.framework.Logger.Dangerf("MustRender panics for client with IP: %s On template: %s.Trace: %s\n", ctx.RemoteAddr(), name, err)
if ctx.framework.Config.IsDevelopment {
ctx.framework.Logger.Printf("MustRender panics for client with IP: %s On template: %s.Trace: %s\n", ctx.RemoteAddr(), name, err)
}
}
}
@@ -978,3 +980,8 @@ func (ctx *Context) SessionDestroy() {
func (ctx *Context) Log(format string, a ...interface{}) {
ctx.framework.Logger.Printf(format, a...)
}
// Framework returns the Iris instance, containing the configuration and all other fields
func (ctx *Context) Framework() *Framework {
return ctx.framework
}