Sha256: a71d7b8cfdc08a671ebce9ac972a9a4bf91d9447c3d96d21e71a52a4ad8069db

Contents?: true

Size: 753 Bytes

Versions: 4

Compression:

Stored size: 753 Bytes

Contents

require 'hanami/logger'

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

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hanami-model-1.0.0.rc1 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.0.beta3 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.0.beta2 lib/hanami/model/migrator/logger.rb
hanami-model-1.0.0.beta1 lib/hanami/model/migrator/logger.rb