mirror of
https://github.com/labstack/echo.git
synced 2025-07-15 01:34:53 +02:00
Added API to enable/disable colored log.
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
8
echo.go
8
echo.go
@ -158,7 +158,7 @@ func New() (e *Echo) {
|
|||||||
//----------
|
//----------
|
||||||
|
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
e.DisableColoredLog()
|
e.ColoredLog(false)
|
||||||
}
|
}
|
||||||
e.HTTP2(false)
|
e.HTTP2(false)
|
||||||
e.notFoundHandler = func(c *Context) error {
|
e.notFoundHandler = func(c *Context) error {
|
||||||
@ -195,12 +195,12 @@ func (e *Echo) Router() *Router {
|
|||||||
return e.router
|
return e.router
|
||||||
}
|
}
|
||||||
|
|
||||||
// DisableColoredLog disables colored log.
|
// ColoredLog enable/disable colored log.
|
||||||
func (e *Echo) DisableColoredLog() {
|
func (e *Echo) ColoredLog(on bool) {
|
||||||
color.Disable()
|
color.Disable()
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP2 enables HTTP2 support.
|
// HTTP2 enable/disable HTTP2 support.
|
||||||
func (e *Echo) HTTP2(on bool) {
|
func (e *Echo) HTTP2(on bool) {
|
||||||
e.http2 = on
|
e.http2 = on
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ and message `HTTPError.Message`.
|
|||||||
|
|
||||||
Enables debug mode.
|
Enables debug mode.
|
||||||
|
|
||||||
### Disable colored log
|
### Enable/Disable colored log
|
||||||
|
|
||||||
`Echo.DisableColoredLog()`
|
`Echo.ColoredLog(on bool)`
|
||||||
|
|
||||||
## Routing
|
## Routing
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user