Module: PuppetLibrary::Util::Logging
- Included in:
- Forge::Forge, Git
- Defined in:
- lib/puppet_library/util/logging.rb
Defined Under Namespace
Classes: LogCollector
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #info(message) ⇒ Object
- #logger ⇒ Object
- #logs ⇒ Object
- #warn(message) ⇒ Object
Instance Method Details
#debug(message) ⇒ Object
42 43 44 |
# File 'lib/puppet_library/util/logging.rb', line 42 def debug() logger.debug end |
#info(message) ⇒ Object
46 47 48 |
# File 'lib/puppet_library/util/logging.rb', line 46 def info() logger.info end |
#logger ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/puppet_library/util/logging.rb', line 34 def logger destination = ENV["TESTING"] ? logs : STDERR @logger ||= Logger.new(destination).tap do |logger| logger.progname = self.class.name logger.level = Logger::DEBUG end end |
#logs ⇒ Object
30 31 32 |
# File 'lib/puppet_library/util/logging.rb', line 30 def logs @logs ||= LogCollector.new end |
#warn(message) ⇒ Object
50 51 52 |
# File 'lib/puppet_library/util/logging.rb', line 50 def warn() logger.warn end |