Module: Puppet::Util::Warnings Private
- Included in:
- Indirector::Request, Provider, Provider, Resource::Type, Resource::TypeCollection, Type, Feature, SUIDManager
- Defined in:
- lib/puppet/util/warnings.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Methods to help with handling warnings.
Class Method Summary collapse
- .clear_warnings ⇒ Object private
- .debug_once(msg) ⇒ Object private
- .maybe_log(message, klass) ⇒ Object private
- .notice_once(msg) ⇒ Object private
- .warnonce(msg) ⇒ Object private
Class Method Details
.clear_warnings ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 22 |
# File 'lib/puppet/util/warnings.rb', line 19 def clear_warnings @stampwarnings = {} nil end |
.debug_once(msg) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 13 |
# File 'lib/puppet/util/warnings.rb', line 10 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
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 30 31 |
# File 'lib/puppet/util/warnings.rb', line 24 def self.maybe_log(, klass) @stampwarnings ||= {} @stampwarnings[klass] ||= [] return nil if @stampwarnings[klass].include? yield @stampwarnings[klass] << nil end |
.notice_once(msg) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/puppet/util/warnings.rb', line 6 def notice_once(msg) Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.notice msg } end |
.warnonce(msg) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/puppet/util/warnings.rb', line 15 def warnonce(msg) Puppet::Util::Warnings.maybe_log(msg, self.class) { Puppet.warning msg } end |