Sha256: 36ed220509ee5aab0c40571f95b37ae7c0d32c3173a42511396f510328e61c06
Contents?: true
Size: 848 Bytes
Versions: 4
Compression:
Stored size: 848 Bytes
Contents
# frozen_string_literal: true require "dry/logger/constants" module Dry module Logger module Backends module Core # Return a proc used by the log? predicate # # @since 1.0.0 # @api private attr_reader :log_if # Set a predicate proc that checks if an entry should be logged by a given backend # # The predicate will receive {Entry} as its argument and should return true/false # # @param [Proc, #to_proc] spec A proc-like object # @since 1.0.0 # @api public def log_if=(spec) @log_if = spec&.to_proc end # @since 1.0.0 # @api private def log?(entry) if log_if log_if.call(entry) else true end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems