require 'alephant/renderer/version'
require 'alephant/renderer/view_mapper'
require 'alephant/logger'

module Alephant
  module Renderer
    def self.create(config, data)
      Renderer.new(config, data)
    end

    class Renderer
      include Logger

      attr_reader :config, :data

      def initialize(config, data)
        @config = config
        @data   = data
      end

      def views
        mapper.generate data
      end

      private

      def mapper
        @mapper ||= begin
          logger.info(
            event:      :ViewMapperCreated,
            rendererId: config[:renderer_id],
            viewPath:   config[:view_path],
            method:     "#{self.class}#mapper"
          )

          ViewMapper.new(config[:renderer_id], config[:view_path])
        end
      end
    end
  end
end

require 'alephant/renderer/version'
require 'alephant/renderer/view_mapper'
require 'alephant/logger'

module Alephant
  module Renderer
    def self.create(config, data)
      Renderer.new(config, data)
    end

    class Renderer
      include Logger

      attr_reader :config, :data

      def initialize(config, data)
        @config = config
        @data   = data
      end

      def views
        mapper.generate data
      end

      private

      def mapper
        @mapper ||= begin
          logger.debug(
            event:      :ViewMapperCreated,
            rendererId: config[:renderer_id],
            viewPath:   config[:view_path],
            method:     "#{self.class}#mapper"
          )

          ViewMapper.new(config[:renderer_id], config[:view_path])
        end
      end
    end
  end
end

Update log level from info
Update log level from info
