Sha256: 2dd12ecbbcf95bc5e05c62c3ea158a633c549f25deff31fb8d4d2f9bb2181b0c

Contents?: true

Size: 1.42 KB

Versions: 11

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true

module Logster
  class Configuration
    attr_accessor(
      :allow_grouping,
      :application_version,
      :current_context,
      :env_expandable_keys,
      :enable_custom_patterns_via_ui,
      :enable_js_error_reporting,
      :environments,
      :rate_limit_error_reporting,
      :web_title,
      :maximum_message_size_bytes,
      :project_directories,
      :enable_backtrace_links,
      :gems_dir,
      :max_env_bytes,
      :max_env_count_per_message,
      :maximum_message_length,
      :use_full_hostname
    )

    attr_writer :subdirectory

    def initialize
      # lambda |env,block|
      @current_context = lambda { |_, &block| block.call }
      @environments = [:development, :production]
      @subdirectory = nil
      @env_expandable_keys = []
      @enable_custom_patterns_via_ui = false
      @rate_limit_error_reporting = true
      @enable_js_error_reporting = true
      @maximum_message_size_bytes = 10_000
      @max_env_bytes = 1000
      @max_env_count_per_message = 50
      @project_directories = []
      @enable_backtrace_links = true
      @gems_dir = Gem.dir + "/gems/"
      @maximum_message_length = 2000
      @use_full_hostname = nil

      @allow_grouping = false

      if defined?(::Rails) && defined?(::Rails.env) && ::Rails.env.production?
        @allow_grouping = true
      end
    end

    def subdirectory
      @subdirectory || '/logs'
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
logster-2.12.2 lib/logster/configuration.rb
logster-2.12.1 lib/logster/configuration.rb
logster-2.11.4 lib/logster/configuration.rb
logster-2.11.3 lib/logster/configuration.rb
logster-2.11.2 lib/logster/configuration.rb
logster-2.11.1 lib/logster/configuration.rb
logster-2.11.0 lib/logster/configuration.rb
logster-2.10.1 lib/logster/configuration.rb
logster-2.10.0 lib/logster/configuration.rb
logster-2.9.8 lib/logster/configuration.rb
logster-2.9.7 lib/logster/configuration.rb