logger.go 314 B

12345678910111213141516171819202122
  1. package test
  2. type Logger interface {
  3. Output(maxdepth int, s string) error
  4. }
  5. type tbLog interface {
  6. Log(...interface{})
  7. }
  8. type testLogger struct {
  9. tbLog
  10. }
  11. func (tl *testLogger) Output(maxdepth int, s string) error {
  12. tl.Log(s)
  13. return nil
  14. }
  15. func NewTestLogger(tbl tbLog) Logger {
  16. return &testLogger{tbl}
  17. }