Sha256: 13052aa82a60bb0c91c2270269817076236b5f2cc24c1d073ff7e29d3a3fdcd5
Contents?: true
Size: 727 Bytes
Versions: 12
Compression:
Stored size: 727 Bytes
Contents
# frozen_string_literal: true module Pakyow module Actions # Sets up a connection logger and logs the prologue/epilogue. # class Logger def call(connection, &block) if silence?(connection) connection.logger.silence do call_with_logging(connection, &block) end else call_with_logging(connection, &block) end end private def call_with_logging(connection) connection.logger.prologue(connection) yield connection.logger.epilogue(connection) end def silence?(connection) Pakyow.silencers.any? { |silencer| silencer.call(connection) } end end end end
Version data entries
12 entries across 12 versions & 1 rubygems