Class: Puppet::Util::Log::RateLimitedLogger
- Includes:
- Puppet::Util::Logging
- Defined in:
- lib/puppet/util/log/rate_limited_logger.rb
Overview
Logging utility class that limits the frequency of identical log messages
Instance Method Summary collapse
-
#initialize(interval) ⇒ RateLimitedLogger
constructor
A new instance of RateLimitedLogger.
-
#send_log(level, message) ⇒ Object
Override the logging entry point to rate-limit it.
Methods included from Puppet::Util::Logging
#clear_deprecation_warnings, #deprecation_warning, #format_exception, #get_deprecation_offender, #log_and_raise, #log_deprecations_to_file, #log_exception, #puppet_deprecation_warning
Constructor Details
#initialize(interval) ⇒ RateLimitedLogger
Returns a new instance of RateLimitedLogger.
7 8 9 10 11 |
# 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 |