# class Log::RateLimitedLogger

Logging utility class that limits the frequency of identical log messages

### Public Class Methods

new(interval) click to toggle source

    # File lib/puppet/util/log/rate_limited_logger.rb, line 7
    def initialize(interval)
      raise ArgumentError, "Logging rate-limit interval must be an integer" unless interval.is_a?(Integer)
      @interval = interval
      @log_record = {}
    end

### Public Instance Methods

send_log(level, message) click to toggle source

Override the logging entry point to rate-limit it

    # File lib/puppet/util/log/rate_limited_logger.rb, line 14
    def send_log(level, message)
      Puppet::Util::Log.create({:level => level, :message => message}) if should_log?(level, message)
    end