Sha256: 27df2ee412f2ac9d7bd493c79e6866c89597ad916064235cd162b3b96e67b1f0

Contents?: true

Size: 729 Bytes

Versions: 19

Compression:

Stored size: 729 Bytes

Contents

require 'hanami/logger'

module Hanami
  module Model
    class Migrator
      # Automatic logger for migrations
      #
      # @since 1.0.0
      # @api private
      class Logger < Hanami::Logger
        # Formatter for migrations logger
        #
        # @since 1.0.0
        # @api private
        class Formatter < Hanami::Logger::Formatter
          private

          # @since 1.0.0
          # @api private
          def _format(hash)
            "[hanami] [#{hash.fetch(:severity)}] #{hash.fetch(:message)}\n"
          end
        end

        # @since 1.0.0
        # @api private
        def initialize(stream)
          super(nil, stream: stream, formatter: Formatter.new)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
hanami-model-1.3.2 lib/hanami/model/migrator/logger.rb
hanami-model-1.3.1 lib/hanami/model/migrator/logger.rb
hanami-model-1.3.0 lib/hanami/model/migrator/logger.rb
hanami-model-1.3.0.beta1 lib/hanami/model/migrator/logger.rb
hanami-model-1.2.0 lib/hanami/model/migrator/logger.rb
hanami-model-1.2.0.rc2 lib/hanami/model/migrator/logger.rb
hanami-model-1.2.0.rc1 lib/hanami/model/migrator/logger.rb
hanami-model-1.2.0.beta2 lib/hanami/model/migrator/logger.rb
hanami-model-1.2.0.beta1 lib/hanami/model/migrator/logger.rb
hanami-model-1.1.0 lib/hanami/model/migrator/logger.rb
hanami-model-1.1.0.rc1 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.4 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.3 lib/hanami/model/migrator/logger.rb
hanami-model-1.1.0.beta3 lib/hanami/model/migrator/logger.rb
hanami-model-1.1.0.beta2 lib/hanami/model/migrator/logger.rb
hanami-model-1.1.0.beta1 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.2 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.1 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.0 lib/hanami/model/migrator/logger.rb