Sha256: 5eb583cbe48c2f95521f7308f690d1bbbba2c59049f4fdaa839c59820b2932ed

Contents?: true

Size: 634 Bytes

Versions: 21

Compression:

Stored size: 634 Bytes

Contents

require 'log4r'

module AwsPocketknife
  module Common
    module Logging

      include Log4r
      Logger = Log4r::Logger
      Log4r::Logger.root.level = Log4r::INFO

      class << self

        def logger
          @log ||= initialize_log
        end

        def initialize_log(name: "aws_pocketknife", pattern: "[%l] %d %m")
          log = Logger.new(name)

          log_format = Log4r::PatternFormatter.new(:pattern => pattern)
          log_output = Log4r::StdoutOutputter.new 'console'
          log_output.formatter = log_format
          log.add(log_output)

          return log
        end

      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
aws_pocketknife-0.1.28 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.27 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.26 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.25 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.24 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.23 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.21 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.20 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.19 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.18 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.17 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.16 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.15 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.14 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.13 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.12 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.11 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.10 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.9 lib/aws_pocketknife/common/logging.rb
aws_pocketknife-0.1.8 lib/aws_pocketknife/common/logging.rb