Sha256: 078080ea1f3e80917c8dd5601feb6dd4927ba88555087b01cc384fbd91d1e9ca

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

module FlowNodePatron
  module Utils
    module Logger
      extend ActiveSupport::Concern
      class_methods do
        def logger
          return @log unless @log.nil?
          create_log
        end

        def create_log(param = nil)
          @log = case param
                 when 'stdout'
                   ::Logger.new IO::STDOUT
                 when 'stderr'
                   ::Logger.new IO::STDERR
                 else
                   file = File.new('flow_node_patron.log', 'a')
                   file.sync = true
                   logger = ::Logger.new file
                   logger
                 end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flow_org_patron-0.1.1 lib/flow_node_patron/utils/logger.rb