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

add Party.SetRoutesNoLog and mvc.Application.SetControllersNoLog as requested at #1630

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-15 00:23:09 +03:00
parent 0f7cf7f35c
commit 3baee7db34
6 changed files with 92 additions and 20 deletions

View File

@@ -14,12 +14,17 @@ func main() {
app := iris.New()
app.Use(recover.New())
app.Logger().SetLevel("debug")
// Disable verbose logging of routes for this and its children parties
// when the log level is "debug": app.SetRoutesNoLog(true)
mvc.Configure(app.Party("/basic"), basicMVC)
app.Listen(":8080")
}
func basicMVC(app *mvc.Application) {
// Disable verbose logging of controllers for this and its children mvc apps
// when the log level is "debug": app.SetControllersNoLog(true)
// You can use normal middlewares at MVC apps of course.
app.Router.Use(func(ctx iris.Context) {
ctx.Application().Logger().Infof("Path: %s", ctx.Path())