lib/logjoy.rb in logjoy-0.2.0 vs lib/logjoy.rb in logjoy-0.3.0
- old
+ new
@@ -10,11 +10,12 @@
module Logjoy
class Error < StandardError; end
module_function
- mattr_accessor :customizer
+ mattr_accessor :customizer, :filters
+ self.filters = []
def custom_fields(event)
return {} if customizer.nil?
customizer.call(event)
@@ -22,9 +23,15 @@
def set_customizer(app)
return unless enabled?(app)
self.customizer = app.config.logjoy.customizer
+ end
+
+ def set_path_filters(app)
+ return unless enabled?(app)
+
+ self.filters = app.config.logjoy.filters || []
end
REPLACE_SUBSCRIBERS = %i[action_controller].freeze
DETACH_SUBSCRIBERS = %i[action_view action_mailer active_storage].freeze