mirror of
https://github.com/labstack/echo.git
synced 2025-01-24 03:16:14 +02:00
Merge pull request #202 from labstack/debug-api-changes
Debug api changes
This commit is contained in:
commit
68e00e964c
@ -1,5 +1,6 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.4
|
||||
- tip
|
||||
before_install:
|
||||
- go get github.com/modocache/gover
|
||||
|
11
echo.go
11
echo.go
@ -250,9 +250,14 @@ func (e *Echo) SetRenderer(r Renderer) {
|
||||
e.renderer = r
|
||||
}
|
||||
|
||||
// Debug enables debug mode.
|
||||
func (e *Echo) Debug() {
|
||||
e.debug = true
|
||||
// SetDebug enables/disables debug mode.
|
||||
func (e *Echo) SetDebug(on bool) {
|
||||
e.debug = on
|
||||
}
|
||||
|
||||
// Debug returns debug mode (enabled or disabled).
|
||||
func (e *Echo) Debug() bool {
|
||||
return e.debug
|
||||
}
|
||||
|
||||
// StripTrailingSlash enables removing trailing slash from the request path.
|
||||
|
@ -33,7 +33,7 @@ func TestEcho(t *testing.T) {
|
||||
assert.NotNil(t, e.Router())
|
||||
|
||||
// Debug
|
||||
e.Debug()
|
||||
e.SetDebug(true)
|
||||
assert.True(t, e.debug)
|
||||
|
||||
// DefaultHTTPErrorHandler
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
|
||||
func TestRecover(t *testing.T) {
|
||||
e := echo.New()
|
||||
e.Debug()
|
||||
e.SetDebug(true)
|
||||
req, _ := http.NewRequest(echo.GET, "/", nil)
|
||||
rec := httptest.NewRecorder()
|
||||
c := echo.NewContext(req, echo.NewResponse(rec), e)
|
||||
|
@ -42,9 +42,9 @@ and message `HTTPError.Message`.
|
||||
|
||||
### Debug
|
||||
|
||||
`Echo.Debug()`
|
||||
`Echo.SetDebug(on bool)`
|
||||
|
||||
Enables debug mode.
|
||||
Enables/disables debug mode.
|
||||
|
||||
### Disable colored log
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user