We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to the wiki, logging can be enabled with the following initializer settings:
Initializer for logger setup:
# config/initializers/wisper.rb Wisper.configure do |config| config.broadcaster :default, Wisper::Broadcasters::LoggerBroadcaster.new( Rails.logger, Wisper::Broadcasters::SendBroadcaster.new ) end
Code Example:
here's my listener configuration:
# config/initializers/listeners.rb Rails.application.config.to_prepare do Wisper.clear if Rails.env.development? || Rails.env.test? Wisper.subscribe(UserCreatedEventHandler, on: :user_created, with: :call) end
The event handler and the model publishing the event:
# app/event_handlers/user_created_event_handler.rb class UserCreatedEventHandler def self.call(user) p('created!!!') end end # app/models/user.rb class User < ApplicationRecord include Wisper::Publisher def do_broadcast broadcast(:user_created, self) end end
Triggering the event:
user = User.first user.do_broadcast # Observed log message: # [WISPER] User#1 published call to UserCreatedEventHandler#104080 with User#1
Expected Behavior: The log message should reflect the actual event name user_created in the output:
user_created
# [WISPER] User#1 published user_created to UserCreatedEventHandler#104080 with User#1
Actual Behavior: The log message incorrectly displays call instead of the event name user_created
call
I am willing to explore a solution and contribute a fix via a PR. Please let me know if any other details are required for investigating this issue.
The text was updated successfully, but these errors were encountered:
Would happily except a PR to fix 👍
Sorry, something went wrong.
fix: Incorrect event name logging with :with option
feb2c2c
related issue: https://github.com/krisleech/wisper/issues/215\
Successfully merging a pull request may close this issue.
According to the wiki, logging can be enabled with the following initializer settings:
Initializer for logger setup:
Code Example:
here's my listener configuration:
The event handler and the model publishing the event:
Triggering the event:
Expected Behavior:
The log message should reflect the actual event name
user_created
in the output:Actual Behavior:
The log message incorrectly displays
call
instead of the event nameuser_created
I am willing to explore a solution and contribute a fix via a PR.
Please let me know if any other details are required for investigating this issue.
The text was updated successfully, but these errors were encountered: