log_subscriber simplified
This commit is contained in:
@@ -84,7 +84,7 @@ module Live
|
||||
value = typed_value(type, raw_value, default)
|
||||
definitions[constant] = { type:, default:, value: }
|
||||
|
||||
puts("-- new definition #{constant}:#{definitions[constant]}")
|
||||
# puts("-- new definition #{constant}:#{definitions[constant]}")
|
||||
value
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module Semantic
|
||||
module Subscribers
|
||||
# LogSubscriber for event_group :action_controller
|
||||
class ActionController < LogSubscriber
|
||||
include AnsiColors
|
||||
|
||||
@@ -8,9 +9,9 @@ module Semantic
|
||||
TERMINUS_STRING = '╙─╜'.freeze
|
||||
|
||||
def initialize(session_key)
|
||||
super()
|
||||
@session_key = session_key
|
||||
@transactions = {}
|
||||
super(:action_controller)
|
||||
end
|
||||
|
||||
def start_processing(event)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module Semantic
|
||||
module Subscribers
|
||||
# LogSubscriber for event_group :action_view
|
||||
class ActionView < LogSubscriber
|
||||
include AnsiColors
|
||||
|
||||
@@ -7,10 +8,6 @@ module Semantic
|
||||
|
||||
attr_reader :logger
|
||||
|
||||
def initialize
|
||||
super(:action_view)
|
||||
end
|
||||
|
||||
def render_partial(event)
|
||||
identifier = pathname(event.payload[:identifier])
|
||||
# logger.debug("Rendered partial #{identifier}", event.payload[:locals]) if identifier
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
module Semantic
|
||||
module Subscribers
|
||||
# Abstract LogSubscriber
|
||||
class LogSubscriber
|
||||
attr_reader :logger, :event_group
|
||||
|
||||
def initialize(event_group)
|
||||
@event_group = event_group
|
||||
@logger = SemanticLogger[event_group.to_s]
|
||||
def initialize
|
||||
@event_group = self.class.name.demodulize.underscore.to_sym
|
||||
@logger = SemanticLogger[@event_group]
|
||||
end
|
||||
|
||||
def any_hook(event)
|
||||
|
||||
Reference in New Issue
Block a user