lesslogger.go 421 B

1234567891011121314151617181920212223
  1. package logx
  2. type LessLogger struct {
  3. *limitedExecutor
  4. }
  5. func NewLessLogger(milliseconds int) *LessLogger {
  6. return &LessLogger{
  7. limitedExecutor: newLimitedExecutor(milliseconds),
  8. }
  9. }
  10. func (logger *LessLogger) Error(v ...interface{}) {
  11. logger.logOrDiscard(func() {
  12. Error(v...)
  13. })
  14. }
  15. func (logger *LessLogger) Errorf(format string, v ...interface{}) {
  16. logger.logOrDiscard(func() {
  17. Errorf(format, v...)
  18. })
  19. }