Sha256: d807168bb339db9ed09b592866beeb4b0d4b9219970fcb3b57a2999881e1e4b4

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

module Hanami
  module Providers
    # @api private
    # @since 2.2.0
    class DBLogging < Hanami::Provider::Source
      # @api private
      # @since 2.2.0
      def prepare
        require "dry/monitor/sql/logger"
        slice["notifications"].register_event :sql
      end

      # @api private
      # @since 2.2.0
      def start
        Dry::Monitor::SQL::Logger.new(slice["logger"]).subscribe(slice["notifications"])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hanami-2.2.1 lib/hanami/providers/db_logging.rb
hanami-2.2.0 lib/hanami/providers/db_logging.rb
hanami-2.2.0.rc1 lib/hanami/providers/db_logging.rb
hanami-2.2.0.beta2 lib/hanami/providers/db_logging.rb