mirror of
https://github.com/labstack/echo.git
synced 2025-02-03 13:11:39 +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
|
language: go
|
||||||
go:
|
go:
|
||||||
|
- 1.4
|
||||||
- tip
|
- tip
|
||||||
before_install:
|
before_install:
|
||||||
- go get github.com/modocache/gover
|
- 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
|
e.renderer = r
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug enables debug mode.
|
// SetDebug enables/disables debug mode.
|
||||||
func (e *Echo) Debug() {
|
func (e *Echo) SetDebug(on bool) {
|
||||||
e.debug = true
|
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.
|
// StripTrailingSlash enables removing trailing slash from the request path.
|
||||||
|
@ -33,7 +33,7 @@ func TestEcho(t *testing.T) {
|
|||||||
assert.NotNil(t, e.Router())
|
assert.NotNil(t, e.Router())
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
e.Debug()
|
e.SetDebug(true)
|
||||||
assert.True(t, e.debug)
|
assert.True(t, e.debug)
|
||||||
|
|
||||||
// DefaultHTTPErrorHandler
|
// DefaultHTTPErrorHandler
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
func TestRecover(t *testing.T) {
|
func TestRecover(t *testing.T) {
|
||||||
e := echo.New()
|
e := echo.New()
|
||||||
e.Debug()
|
e.SetDebug(true)
|
||||||
req, _ := http.NewRequest(echo.GET, "/", nil)
|
req, _ := http.NewRequest(echo.GET, "/", nil)
|
||||||
rec := httptest.NewRecorder()
|
rec := httptest.NewRecorder()
|
||||||
c := echo.NewContext(req, echo.NewResponse(rec), e)
|
c := echo.NewContext(req, echo.NewResponse(rec), e)
|
||||||
|
@ -42,9 +42,9 @@ and message `HTTPError.Message`.
|
|||||||
|
|
||||||
### Debug
|
### Debug
|
||||||
|
|
||||||
`Echo.Debug()`
|
`Echo.SetDebug(on bool)`
|
||||||
|
|
||||||
Enables debug mode.
|
Enables/disables debug mode.
|
||||||
|
|
||||||
### Disable colored log
|
### Disable colored log
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user