Sha256: 7d2b9a537f5c802f702acc08e196b61b4308a8d722962f26a9433e52e404e419

Contents?: true

Size: 446 Bytes

Versions: 9

Compression:

Stored size: 446 Bytes

Contents

require 'logger'
require 'fileutils'

module Puggernaut
  module Logger
    
    def logger
      Puggernaut::Logger.logger
    end
    
    class <<self

      def logger
        unless @logger
          base = Dir.pwd
          FileUtils.mkdir_p("#{base}/log")
          file = File.open("#{base}/log/puggernaut.log", 'a')
          file.sync = true
          @logger = ::Logger.new(file)
        end
        @logger
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puggernaut-0.2.3 lib/puggernaut/logger.rb
puggernaut-0.2.2 lib/puggernaut/logger.rb
puggernaut-0.2.1 lib/puggernaut/logger.rb
puggernaut-0.2.0 lib/puggernaut/logger.rb
puggernaut-0.1.5 lib/puggernaut/logger.rb
puggernaut-0.1.4 lib/puggernaut/logger.rb
puggernaut-0.1.3 lib/puggernaut/logger.rb
puggernaut-0.1.2 lib/puggernaut/logger.rb
puggernaut-0.1.0 lib/puggernaut/logger.rb