Logger

Logger 是一个接口,默认使用 https://github.com/lunny/log 作为Log。你也可以实现你自己的Logger。

  1. type Logger interface {
  2. Debugf(format string, v ...interface{})
  3. Debug(v ...interface{})
  4. Infof(format string, v ...interface{})
  5. Info(v ...interface{})
  6. Warnf(format string, v ...interface{})
  7. Warn(v ...interface{})
  8. Errorf(format string, v ...interface{})
  9. Error(v ...interface{})
  10. }

传入自定义的Logger:

  1. l := log.New(out, "[tango] ", log.Ldefault())
  2. l.SetOutputLevel(log.Ldebug)
  3. t := tango.Classic(l)
  4. t.Run()