Class: RFacter::Util::Logger Private
- Inherits:
-
Logger
- Object
- Logger
- RFacter::Util::Logger
- Defined in:
- lib/rfacter/util/logger.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
RFacter Logger class
This class provides all the methods of a standard Ruby Logger plus the following methods used by the Facter API:
- `warnonce`
- `debugonce`
- `log_exception`
Constant Summary collapse
- @@warn_messages =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
Hash.new
- @@debug_messages =
This classvariable is part of a private API. You should avoid using this classvariable if possible, as it may be removed or be changed in the future.
Hash.new
Instance Method Summary collapse
- #debugonce(msg) ⇒ Object private
- #log_exception(exception, message = nil) ⇒ Object private
- #warnonce(msg) ⇒ Object private
Instance Method Details
#debugonce(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.
27 28 29 30 31 32 |
# File 'lib/rfacter/util/logger.rb', line 27 def debugonce(msg) if @@debug_messages[msg].nil? self.debug(msg) @@debug_messages[msg] = true end end |
#log_exception(exception, message = nil) ⇒ 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.
34 35 36 37 38 39 40 41 42 |
# File 'lib/rfacter/util/logger.rb', line 34 def log_exception(exception, = nil) = exception. if .nil? output = [] output << output.concat(exception.backtrace) self.warn(output.flatten.join("\n")) 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.
20 21 22 23 24 25 |
# File 'lib/rfacter/util/logger.rb', line 20 def warnonce(msg) if @@warn_messages[msg].nil? self.warn(msg) @@warn_messages[msg] = true end end |