另客网go项目公用的代码库

1234567891011121314151617181920212223242526272829
  1. package log
  2. import (
  3. "testing"
  4. "git.links123.net/links123.com/pkg/log/hooks"
  5. )
  6. func TestNewDefaultLogger(t *testing.T) {
  7. err := NewDefaultLogger(&hooks.Project{Name: "n1", Domain: "d1"})
  8. if err != nil {
  9. panic(err)
  10. }
  11. Debug("debug message")
  12. //hook, err := hooks.NewNotificationHook(&hooks.Project{Name: "xxx", Domain: "domain"}, hooks.DefaultMaintainers(), hooks.DefaultNotificationService())
  13. //if err != nil {
  14. // panic(err)
  15. //}
  16. //logger := logrus.New()
  17. //logger.AddHook(hook)
  18. //
  19. //logger.Debug("debug info")
  20. //logger.Info("info info")
  21. //logger.Fatal("fatal info")
  22. //logger.Error("error info")
  23. }