Module: Puppet::Util::Warnings
- Included in:
- Indirector::Request, Provider, Provider, Resource::Type, Resource::TypeCollection, Type, Feature, SUIDManager
- Defined in:
- lib/puppet/util/warnings.rb
Overview
Methods to help with handling warnings.
Class Method Summary collapse
- .clear_warnings ⇒ Object
- .debug_once(msg) ⇒ Object
- .maybe_log(message, klass) ⇒ Object
- .notice_once(msg) ⇒ Object
- .warnonce(msg) ⇒ Object
Class Method Details
.clear_warnings ⇒ Object
21 22 23 24 |
# File 'lib/puppet/util/warnings.rb', line 21 def clear_warnings @stampwarnings = {} nil end |
.debug_once(msg) ⇒ Object
11 12 13 14 15 |
# File 'lib/puppet/util/warnings.rb', line 11 def debug_once(msg) return nil unless Puppet[:debug] Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.debug msg } end |
.maybe_log(message, klass) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/puppet/util/warnings.rb', line 26 def self.maybe_log(, klass) @stampwarnings ||= {} @stampwarnings[klass] ||= [] return nil if @stampwarnings[klass].include? yield @stampwarnings[klass] << nil end |