An open API service indexing awesome lists of open source software.

https://github.com/gregoryv/testlog

Provides ways to redirect log output during testing
https://github.com/gregoryv/testlog

Last synced: 9 months ago
JSON representation

Provides ways to redirect log output during testing

Awesome Lists containing this project

README

          

Package testlog to catch logs while testing

## Quick start

$ go get github.com/gregoryv/testlog

in your code

```go
func TestYourthing(t *testing.T) {
buf := testlog.Catch(t)

// do something

got := buf.String()
exp := "some log phrase"
if !strings.Contains(got, exp) {
t.Error(got, " missing expected ", exp)
}
}
```