Class: Bidi2pdf::Notifications::LoggingSubscriber
- Inherits:
-
Object
- Object
- Bidi2pdf::Notifications::LoggingSubscriber
- Includes:
- LoggingSubscriberActions
- Defined in:
- lib/bidi2pdf/notifications/logging_subscriber.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger: Logger.new($stdout)) ⇒ LoggingSubscriber
constructor
rubocop: disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity.
- #unsubscribe ⇒ Object
Methods included from LoggingSubscriberActions
#handle_response, #network_event_received, #network_idle, #page_loaded, #print, #send_cmd, #send_cmd_and_wait, #session_close
Constructor Details
#initialize(logger: Logger.new($stdout)) ⇒ LoggingSubscriber
rubocop: disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/bidi2pdf/notifications/logging_subscriber.rb', line 110 def initialize(logger: Logger.new($stdout)) @logger = logger Bidi2pdf.notification_service&.subscribe("handle_response.bidi2pdf", &method(:handle_response)) Bidi2pdf.notification_service&.subscribe("send_cmd.bidi2pdf", &method(:send_cmd)) Bidi2pdf.notification_service&.subscribe("send_cmd_and_wait.bidi2pdf", &method(:send_cmd_and_wait)) Bidi2pdf.notification_service&.subscribe("session_close.bidi2pdf", &method(:session_close)) Bidi2pdf.notification_service&.subscribe("network_idle.bidi2pdf", &method(:network_idle)) Bidi2pdf.notification_service&.subscribe("page_loaded.bidi2pdf", &method(:page_loaded)) Bidi2pdf.notification_service&.subscribe("network_event_received.bidi2pdf", &method(:network_event_received)) Bidi2pdf.notification_service&.subscribe("print.bidi2pdf", &method(:network_event_received)) end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
107 108 109 |
# File 'lib/bidi2pdf/notifications/logging_subscriber.rb', line 107 def logger @logger end |
Instance Method Details
#unsubscribe ⇒ Object
122 123 124 125 126 127 128 129 130 131 |
# File 'lib/bidi2pdf/notifications/logging_subscriber.rb', line 122 def unsubscribe Bidi2pdf.notification_service&.unsubscribe("handle_response.bidi2pdf", &method(:handle_response)) Bidi2pdf.notification_service&.unsubscribe("send_cmd.bidi2pdf", &method(:send_cmd)) Bidi2pdf.notification_service&.unsubscribe("send_cmd_and_wait.bidi2pdf", &method(:send_cmd_and_wait)) Bidi2pdf.notification_service&.unsubscribe("session_close.bidi2pdf", &method(:session_close)) Bidi2pdf.notification_service&.unsubscribe("network_idle.bidi2pdf", &method(:network_idle)) Bidi2pdf.notification_service&.unsubscribe("page_loaded.bidi2pdf", &method(:page_loaded)) Bidi2pdf.notification_service&.unsubscribe("network_event_received.bidi2pdf", &method(:network_event_received)) Bidi2pdf.notification_service&.unsubscribe("print.bidi2pdf", &method(:network_event_received)) end |