Class: Mbeditor::CableLogFilter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Mbeditor::CableLogFilter
- Defined in:
- lib/mbeditor/cable_log_filter.rb
Overview
Wraps the ActionCable logger and suppresses all log lines that mention Mbeditor channels so the development console stays readable. Non-Mbeditor ActionCable messages pass through unchanged.
Constant Summary collapse
- SUPPRESS_PATTERN =
/Mbeditor::|mbeditor_editor/
Instance Method Summary collapse
- #clear_tags! ⇒ Object
-
#current_tags ⇒ Object
Rails/ActiveSupport logger compatibility.
- #pop_tags(count = 1) ⇒ Object
- #push_tags(*tags) ⇒ Object
-
#tagged(*tags, &block) ⇒ Object
Tagged-logging compat — the block body still passes through the filter.
Instance Method Details
#clear_tags! ⇒ Object
50 51 52 53 54 |
# File 'lib/mbeditor/cable_log_filter.rb', line 50 def return __getobj__. if __getobj__.respond_to?(:clear_tags!) nil end |
#current_tags ⇒ Object
Rails/ActiveSupport logger compatibility. Some logger stacks call these methods even when the underlying logger is not TaggedLogging.
32 33 34 35 36 |
# File 'lib/mbeditor/cable_log_filter.rb', line 32 def return __getobj__. if __getobj__.respond_to?(:current_tags) [] end |
#pop_tags(count = 1) ⇒ Object
44 45 46 47 48 |
# File 'lib/mbeditor/cable_log_filter.rb', line 44 def (count = 1) return __getobj__.(count) if __getobj__.respond_to?(:pop_tags) [] end |
#push_tags(*tags) ⇒ Object
38 39 40 41 42 |
# File 'lib/mbeditor/cable_log_filter.rb', line 38 def (*) return __getobj__.(*) if __getobj__.respond_to?(:push_tags) end |
#tagged(*tags, &block) ⇒ Object
Tagged-logging compat — the block body still passes through the filter.
20 21 22 23 24 25 26 27 28 |
# File 'lib/mbeditor/cable_log_filter.rb', line 20 def tagged(*, &block) if __getobj__.respond_to?(:tagged) __getobj__.tagged(*, &block) elsif block block.call else self end end |