diff --git a/config/logger.go b/config/logger.go index 2972b21e..094a1120 100644 --- a/config/logger.go +++ b/config/logger.go @@ -9,6 +9,7 @@ import ( "os" ) +// DefaultLoggerPrefix is the prefix (expect the [IRIS]), is empty for now const DefaultLoggerPrefix = "" var ( diff --git a/http.go b/http.go index 8c0903c7..ae364b67 100644 --- a/http.go +++ b/http.go @@ -1240,7 +1240,7 @@ func (mux *serveMux) build() { } } // I decide that it's better to explicit give subdomain and a path to it than registedPath(mysubdomain./something) now its: subdomain: mysubdomain., path: /something - // we have different tree for each of subdomains, now you can use everyting you can use with the normal paths ( before you couldn't set /any/*path) + // we have different tree for each of subdomains, now you can use everything you can use with the normal paths ( before you couldn't set /any/*path) if err := tree.entry.add(r.path, r.middleware); err != nil { mux.logger.Panic(err.Error()) } diff --git a/iris.go b/iris.go index 7d3e794f..d2712b8b 100644 --- a/iris.go +++ b/iris.go @@ -320,7 +320,7 @@ func (s *Framework) Close() { s.Must(s.CloseWithErr()) } -// MustUse registers Handler middleware to the beggining, prepends them instead of append +// MustUse registers Handler middleware to the beginning, prepends them instead of append // // Use it when you want to add a global middleware to all parties, to all routes in all subdomains // It can be called after other, (but before .Listen of course) @@ -328,7 +328,7 @@ func MustUse(handlers ...Handler) { Default.MustUse(handlers...) } -// MustUseFunc registers HandlerFunc middleware to the beggining, prepends them instead of append +// MustUseFunc registers HandlerFunc middleware to the beginning, prepends them instead of append // // Use it when you want to add a global middleware to all parties, to all routes in all subdomains // It can be called after other, (but before .Listen of course) @@ -336,7 +336,7 @@ func MustUseFunc(handlersFn ...HandlerFunc) { Default.MustUseFunc(handlersFn...) } -// MustUse registers Handler middleware to the beggining, prepends them instead of append +// MustUse registers Handler middleware to the beginning, prepends them instead of append // // Use it when you want to add a global middleware to all parties, to all routes in all subdomains // It can be called after other, (but before .Listen of course) @@ -346,7 +346,7 @@ func (s *Framework) MustUse(handlers ...Handler) { } } -// MustUseFunc registers HandlerFunc middleware to the beggining, prepends them instead of append +// MustUseFunc registers HandlerFunc middleware to the beginning, prepends them instead of append // // Use it when you want to add a global middleware to all parties, to all routes in all subdomains // It can be called after other, (but before .Listen of course) diff --git a/logger/logger.go b/logger/logger.go index 3bd0a83f..75b4e7df 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -52,19 +52,19 @@ func (l *Logger) ResetColors() { // PrintBanner prints a text (banner) with BannerFgColor, BannerBgColor and a success message at the end // It doesn't cares if the logger is disabled or not, it will print this -func (l *Logger) PrintBanner(banner string, sucessMessage string) { +func (l *Logger) PrintBanner(banner string, successMessage string) { c := color.New(attr(l.config.ColorBgDefault), attr(l.config.ColorFgBanner), color.Bold) c.Println(banner) bannersRan++ - if sucessMessage != "" { + if successMessage != "" { c.Add(attr(l.config.ColorBgSuccess), attr(l.config.ColorFgSuccess), color.Bold) if bannersRan > 1 { c.Printf("Server[%#v]\n", bannersRan) } - c.Println(sucessMessage) + c.Println(successMessage) } c.DisableColor() @@ -120,9 +120,9 @@ func (l *Logger) Panicf(format string, a ...interface{}) { panic("") } -// Sucessf calls l.Output to print to the logger with the Success colors. +// Successf calls l.Output to print to the logger with the Success colors. // Arguments are handled in the manner of fmt.Printf. -func (l *Logger) Sucessf(format string, a ...interface{}) { +func (l *Logger) Successf(format string, a ...interface{}) { if !l.config.Disabled { l.underline.Add(attr(l.config.ColorBgSuccess), attr(l.config.ColorFgSuccess)) l.Printf(format, a...) diff --git a/middleware/logger/logger.go b/middleware/logger/logger.go index 5fa5f613..1c9b3719 100644 --- a/middleware/logger/logger.go +++ b/middleware/logger/logger.go @@ -82,7 +82,7 @@ func (l *loggerMiddleware) printf(format string, a ...interface{}) { } } -// Default returns the logger middleware as Handler with the default settings +// New returns the logger middleware as HandlerFunc with the default settings if second parameter is not passed func New(theLogger *logger.Logger, options ...Options) iris.HandlerFunc { if theLogger == nil { theLogger = logger.New(config.DefaultLogger()) diff --git a/render/template/engine/html/html.go b/render/template/engine/html/html.go index 175ffcff..d13a3589 100644 --- a/render/template/engine/html/html.go +++ b/render/template/engine/html/html.go @@ -160,6 +160,9 @@ func (s *Engine) buildFromAsset() error { if s.Config.Engine == config.JadeEngine { contents, err = jade.Parse(name, contents) } + if err != nil { + return err + } // Add our funcmaps. if s.Config.HTMLTemplate.Funcs != nil {