logger_test.go 365 B

1234567891011121314151617181920
  1. package logger
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. logCore "gogs.baozhida.cn/zoie/OAuth-core/logger"
  7. "gorm.io/gorm/logger"
  8. )
  9. func TestNew(t *testing.T) {
  10. l := New(logger.Config{
  11. SlowThreshold: time.Second,
  12. Colorful: true,
  13. LogLevel: logger.LogLevel(
  14. logCore.DefaultLogger.Options().Level.LevelForGorm()),
  15. })
  16. l.Info(context.TODO(), "test")
  17. }