logger_test.go 345 B

12345678910111213141516171819
  1. package log
  2. import "testing"
  3. func TestSLogger_Debug(t *testing.T) {
  4. logger := NewSLogger("./debug.log", "debug")
  5. SetDefaultLogger(logger)
  6. Debug("good")
  7. Warn("hhhh")
  8. }
  9. func TestSLogger_Error(t *testing.T) {
  10. logger := NewSLogger("./error.log", "info")
  11. SetDefaultLogger(logger)
  12. Debug("debug")
  13. Info("info")
  14. Error("good")
  15. Warn("hhhh")
  16. }