<commit_before># frozen-string-literal: true

#
class Roda
  module RodaPlugins
    # The skip_common_logger plugin allows for skipping common_logger logging
    # of some requests. You pass a block when loading the plugin, and the
    # block will be called before logging each request.  The block should return
    # whether the 
    # a false/nil value, the request is not logged.
    #
    # Example:
    #
    #   # Only log server errors
    #   plugin :filter_common_logger do |result|
    #     result[0] >= 500
    #   end
    #
    #   # Don't log requests to certain paths
    #   plugin :filter_common_logger do |_|
    #     # Block is called in the same context as the route block
    #     !request.path.start_with?('/admin/')
    #   end
    module FilterCommonLogger
      def self.load_dependencies(app)
        app.plugin :common_logger
      end

      def self.configure(app, &block)
        app.send(:define_method, :_common_log_request?, &block)
        app.send(:private, :_common_log_request?)
        app.send(:alias_method, :_common_log_request?, :_common_log_request?)<commit_msg>Fix documentation for filter_common_logger plugin<commit_after># frozen-string-literal: true

#
class Roda
  module RodaPlugins
    # The skip_common_logger plugin allows for skipping common_logger logging
    # of some requests. You pass a block when loading the plugin, and the
    # block will be called before logging each request.  The block should return
    # whether the request should be logged.
    #
    # Example:
    #
    #   # Only log server errors
    #   plugin :filter_common_logger do |result|
    #     result[0] >= 500
    #   end
    #
    #   # Don't log requests to certain paths
    #   plugin :filter_common_logger do |_|
    #     # Block is called in the same context as the route block
    #     !request.path.start_with?('/admin/')
    #   end
    module FilterCommonLogger
      def self.load_dependencies(app)
        app.plugin :common_logger
      end

      def self.configure(app, &block)
        app.send(:define_method, :_common_log_request?, &block)
        app.send(:private, :_common_log_request?)
        app.send(:alias_method, :_common_log_request?, :_common_log_request?)
{'fraction_non_alphanumeric': 0.08224719101123595, 'fraction_numerical': 0.0035955056179775282, 'mean_word_length': 2.7857142857142856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1676423', 'n_tokens_mistral': 662, 'n_tokens_neox': 646, 'n_words': 203}