mirror of
https://github.com/kataras/iris.git
synced 2025-12-27 06:47:08 +00:00
add IsDebug() shortcut method
This commit is contained in:
@@ -19,6 +19,11 @@ type Application interface {
|
||||
|
||||
// Logger returns the golog logger instance(pointer) that is being used inside the "app".
|
||||
Logger() *golog.Logger
|
||||
// IsDebug reports whether the application is running
|
||||
// under debug/development mode.
|
||||
// It's just a shortcut of Logger().Level >= golog.DebugLevel.
|
||||
// The same method existss as Context.IsDebug() too.
|
||||
IsDebug() bool
|
||||
|
||||
// I18nReadOnly returns the i18n's read-only features.
|
||||
I18nReadOnly() I18nReadOnly
|
||||
|
||||
@@ -5054,6 +5054,12 @@ func (ctx *Context) Application() Application {
|
||||
return ctx.app
|
||||
}
|
||||
|
||||
// IsDebug reports whether the application runs with debug log level.
|
||||
// It is a shortcut of Application.IsDebug().
|
||||
func (ctx *Context) IsDebug() bool {
|
||||
return ctx.app.IsDebug()
|
||||
}
|
||||
|
||||
const errorContextKey = "iris.context.error"
|
||||
|
||||
// SetErr is just a helper that sets an error value
|
||||
|
||||
Reference in New Issue
Block a user