Sha256: 946e3f2c1378ed534f5259b2b93011826cf80ffef301f5e2b35e6b64a1fe6a06

Contents?: true

Size: 493 Bytes

Versions: 21

Compression:

Stored size: 493 Bytes

Contents

require 'logger'

# A module that provides logger and log_file attached to an integration log file
module Loggable
  # The file that logs will go do, using the class name as a differentiator
  def log_file
    return @log_file if @log_file
    @log_file = $base_dir.join('..', 'log', "#{self.class}-integration.log")
    @log_file.dirname.mkpath
    @log_file
  end

  # The logger object so you can say logger.info to log messages
  def logger
    @logger ||= Logger.new(log_file)
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
knife-solo-0.7.0 test/support/loggable.rb
knife-solo-0.7.0.pre3 test/support/loggable.rb
knife-solo-0.7.0.pre2 test/support/loggable.rb
knife-solo-0.7.0.pre test/support/loggable.rb
knife-solo-0.6.0 test/support/loggable.rb
knife-solo-0.4.3 test/support/loggable.rb
knife-solo-0.5.1 test/support/loggable.rb
knife-solo-0.5.0 test/support/loggable.rb
knife-solo-0.4.2 test/support/loggable.rb
knife-solo-0.4.1 test/support/loggable.rb
knife-solo-0.4.0 test/support/loggable.rb
knife-solo-0.3.0 test/support/loggable.rb
knife-solo-0.3.0.pre5 test/support/loggable.rb
knife-solo-0.3.0.pre4 test/support/loggable.rb
knife-solo-0.3.0.pre3 test/support/loggable.rb
knife-solo-0.3.0.pre2 test/support/loggable.rb
knife-solo-0.3.0.pre1 test/support/loggable.rb
knife-solo-0.2.0 test/support/loggable.rb
knife-solo-0.2.0.pre1 test/support/loggable.rb
knife-solo-0.1.0 test/support/loggable.rb