Sha256: 009f789912aaa1f0383ced40db5aec080ac2529bd9bab52f26e88f8b2d619b62

Contents?: true

Size: 770 Bytes

Versions: 3

Compression:

Stored size: 770 Bytes

Contents

require 'hanami/logger'

module Hanami
  module Components
    module App
      # hanami/logger configuration for a sigle Hanami application in the project.
      #
      # @since 0.9.0
      # @api private
      class Logger
        # Configure hanami/logger for a single Hanami application in the project.
        #
        # @param app [Hanami::Configuration::App] a Hanami application
        #
        # @since 0.9.0
        # @api private
        def self.resolve(app)
          namespace = app.namespace
          return unless namespace.logger.nil?

          config = app.configuration

          # TODO: review this logic
          config.logger.app_name(namespace.to_s)
          namespace.logger = config.logger.build
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanami-0.9.2 lib/hanami/components/app/logger.rb
hanami-0.9.1 lib/hanami/components/app/logger.rb
hanami-0.9.0 lib/hanami/components/app/logger.rb