1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 10:57:05 +00:00

Nothing special here. Come on post some good feature requests, I'm starting to get bored!

Former-commit-id: 6afc6ab3a3d2c35bc588dc91c132f1f7a6b24db3
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-02-28 15:41:39 +02:00
parent 963e4609cf
commit f26dd69f9c
4 changed files with 13 additions and 6 deletions

View File

@@ -8,13 +8,16 @@ import (
func main() {
app := iris.New()
app.Adapt(httprouter.New())
app.Adapt(iris.DevLogger()) // fast way to enable non-fatal messages to be printed to the user
// fast way to enable non-fatal messages to be printed to the user
// (yes in iris even recover's errors are not fatal because it's restarting,
// ProdMode messages are only for things that Iris cannot continue at all,
// these are logged by-default but you can change that behavior too by passing a different LoggerPolicy to the .Adapt)
app.Use(recover.New()) // it's io.Writer is the same as app.Config.LoggerOut
app.Adapt(iris.DevLogger())
// adapt a router, you can use gorillamux too
app.Adapt(httprouter.New())
// use this recover(y) middleware
app.Use(recover.New())
i := 0
// let's simmilate a panic every next request