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

add LogLevel/WithLogLevel in Configuration and run Configurators before Build state

Former-commit-id: d38f1fdae98d650692775f4cee06bd017aba959f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-08 03:55:54 +03:00
parent 6a6117eb4f
commit 116503a9a5
6 changed files with 64 additions and 24 deletions

View File

@@ -50,12 +50,14 @@ var ErrNotRouteAdder = errors.New("request handler does not implement AddRoute m
// Works before or after Build state.
// Mainly used for internal cases like `iris.WithSitemap`.
// Do NOT use it on serve-time.
func (router *Router) AddRouteUnsafe(r *Route) error {
func (router *Router) AddRouteUnsafe(routes ...*Route) error {
if h := router.requestHandler; h != nil {
if v, ok := h.(interface {
AddRoute(*Route) error
}); ok {
return v.AddRoute(r)
for _, r := range routes {
return v.AddRoute(r)
}
}
}