Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

noop_test.go 895B

12345678910111213141516171819202122232425262728293031323334
  1. package logger_test
  2. import (
  3. "io"
  4. "testing"
  5. "github.com/9seconds/mtg/v2/logger"
  6. "github.com/9seconds/mtg/v2/testlib"
  7. "github.com/stretchr/testify/suite"
  8. )
  9. type NoopLoggerTestSuite struct {
  10. suite.Suite
  11. }
  12. func (suite *NoopLoggerTestSuite) TestLog() {
  13. suite.Empty(testlib.CaptureStdout(func() {
  14. suite.Empty(testlib.CaptureStderr(func() {
  15. log := logger.NewNoopLogger().Named("name")
  16. log.BindInt("int", 1).BindStr("str", "1").Info("info")
  17. log.BindInt("int", 1).BindStr("str", "1").Warning("info")
  18. log.BindInt("int", 1).BindStr("str", "1").Debug("info")
  19. log.BindInt("int", 1).BindStr("str", "1").InfoError("info", io.EOF)
  20. log.BindInt("int", 1).BindStr("str", "1").WarningError("info", io.EOF)
  21. log.BindInt("int", 1).BindStr("str", "1").DebugError("info", io.EOF)
  22. }))
  23. }))
  24. }
  25. func TestNoopLogger(t *testing.T) {
  26. t.Parallel()
  27. suite.Run(t, &NoopLoggerTestSuite{})
  28. }