1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 12:31:58 +00:00

mvc: struct field and method dependency logs on debug level. Read HISTORY.md

- remove Party.GetReporter

- Read HISTORY.md
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-24 21:44:29 +03:00
parent ef5685bf7e
commit 5e82fa5b89
24 changed files with 435 additions and 167 deletions

15
iris.go
View File

@@ -15,7 +15,6 @@ import (
"time"
"github.com/kataras/iris/v12/context"
"github.com/kataras/iris/v12/core/errgroup"
"github.com/kataras/iris/v12/core/host"
"github.com/kataras/iris/v12/core/netutil"
"github.com/kataras/iris/v12/core/router"
@@ -534,9 +533,6 @@ func (app *Application) Build() error {
app.logger.SetLevel(app.config.LogLevel)
}
rp := errgroup.New("Application Builder")
rp.Err(app.APIBuilder.GetReporter())
if app.defaultMode { // the app.I18n and app.View will be not available until Build.
if !app.I18n.Loaded() {
for _, s := range []string{"./locales/*/*", "./locales/*", "./translations"} {
@@ -585,14 +581,16 @@ func (app *Application) Build() error {
app.view.AddFunc("urlpath", rv.Path)
// app.view.AddFunc("url", rv.URL)
if err := app.view.Load(); err != nil {
rp.Group("View Builder").Err(err)
app.logger.Errorf("View Builder: %v", err)
return err
}
}
if !app.Router.Downgraded() {
// router
if _, err := injectLiveReload(app.ContextPool, app.Router); err != nil {
rp.Errf("LiveReload: init: failed: %v", err)
app.logger.Errorf("LiveReload: init: failed: %v", err)
return err
}
if app.config.ForceLowercaseRouting {
@@ -609,7 +607,8 @@ func (app *Application) Build() error {
routerHandler := router.NewDefaultHandler(app.config, app.logger)
err := app.Router.BuildRouter(app.ContextPool, routerHandler, app.APIBuilder, false)
if err != nil {
rp.Err(err)
app.logger.Error(err)
return err
}
app.HTTPErrorHandler = routerHandler
// re-build of the router from outside can be done with
@@ -619,7 +618,7 @@ func (app *Application) Build() error {
// if end := time.Since(start); end.Seconds() > 5 {
// app.logger.Debugf("Application: build took %s", time.Since(start))
return errgroup.Check(rp)
return nil
}
// Runner is just an interface which accepts the framework instance