Class: Tracing::ActionHandler
- Includes:
- Tracing::Appender::Registration, FilterUse
- Defined in:
- lib/action_handler/action_handler.rb,
lib/action_handler/action_handler_registration.rb
Defined Under Namespace
Modules: Registration
Instance Attribute Summary
Attributes included from Tracing::Appender::Registration
Attributes included from FilterUse
Attributes included from Filter::ExecUse
Attributes included from Filter::Registration
Instance Method Summary collapse
-
#handle(txt, context) ⇒ Object
handle tracelogs by applying filters and action handler methods.
-
#handle_allow(txt, context) ⇒ Object
action for tracelogs that pass the filters by default send to all appenders for further processing!.
-
#handle_not_allow(txt, context) ⇒ Object
action for tracelogs that DO NOT pass the filters.
-
#initialize(init_options) ⇒ ActionHandler
constructor
register filters and appenders.
Methods included from Tracing::Appender::Registration
Methods included from Filter::Registration
#_register_filters, #create_filters, #register_filters, #unregister_filters
Constructor Details
#initialize(init_options) ⇒ ActionHandler
register filters and appenders
12 13 14 15 |
# File 'lib/action_handler/action_handler.rb', line 12 def initialize() register_filters(.filters) register_appenders(.appenders) end |
Instance Method Details
#handle(txt, context) ⇒ Object
handle tracelogs by applying filters and action handler methods
30 31 32 33 34 35 36 37 38 |
# File 'lib/action_handler/action_handler.rb', line 30 def handle(txt, context) if filters_allow?(txt, context) # puts "handle_allow: " + context[:method_name] handle_allow(txt, context) else # puts "handle_not_allow: " + context[:method_name] handle_not_allow(txt, context) end end |
#handle_allow(txt, context) ⇒ Object
action for tracelogs that pass the filters by default send to all appenders for further processing!
19 20 21 22 23 |
# File 'lib/action_handler/action_handler.rb', line 19 def handle_allow(txt, context) appenders.each do |appender| appender.handle(txt, context) end end |
#handle_not_allow(txt, context) ⇒ Object
action for tracelogs that DO NOT pass the filters
26 27 |
# File 'lib/action_handler/action_handler.rb', line 26 def handle_not_allow(txt, context) end |