Sha256: 6af6a9717d6ab1a18dba6da89f7b421709e04c3b4534561229cffdcc3f18d23c

Contents?: true

Size: 550 Bytes

Versions: 20

Compression:

Stored size: 550 Bytes

Contents

require 'active_support/tagged_logging'

module Services
  class Logger
    def initialize
      unless Services.configuration.log_dir.nil?
        log_file = File.join(Services.configuration.log_dir, 'services.log')
        @logger = ActiveSupport::TaggedLogging.new(::Logger.new(log_file))
        @logger.clear_tags!
      end
    end

    def log(tags, message, severity = :info)
      unless @logger.nil?
        @logger.tagged Time.now, severity.upcase, *tags do
          @logger.send severity, message
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
services-0.4.0 lib/services/logger.rb
services-0.3.4 lib/services/logger.rb
services-0.2.14 lib/services/logger.rb
services-0.2.13 lib/services/logger.rb
services-0.2.12 lib/services/logger.rb
services-0.2.11 lib/services/logger.rb
services-0.2.10 lib/services/logger.rb
services-0.2.9 lib/services/logger.rb
services-0.2.8 lib/services/logger.rb
services-0.2.7 lib/services/logger.rb
services-0.2.6 lib/services/logger.rb
services-0.2.5 lib/services/logger.rb
services-0.2.4 lib/services/logger.rb
services-0.2.2 lib/services/logger.rb
services-0.2.1 lib/services/logger.rb
services-0.1.7 lib/services/logger.rb
services-0.1.2 lib/services/logger.rb
services-0.1.0 lib/services/logger.rb
services-0.0.2 lib/services/logger.rb
services-0.0.1 lib/services/logger.rb