-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
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
Disable logging in Rails testing #727
Comments
My recommendation was more for production environment. It is common to disable logging for test environment which is totally fine. Perhaps you can configure logging based on which rails environment it is? |
Cool thanks. Is there a way to disable logging entirely with this gem? |
From the top of my head: no. It seems like a very nice feature to have. Perhaps something like: SidekiqUniqueJobs.configure do |config|
config.logger.level = :fatal
end |
That would work, or alternatively
|
|
I'm not even sure it works without a logger, try it first. Otherwise config.logger = Rails.env.test? ? Logger.new(nil) : Sidekiq.logger Should do the trick, I'll see if I can add a way to just silence logging also. |
Perfect, thanks |
I'm getting a lot of log messages when running Rails specs from this gem. Is there a way to disable these logs in testing? The only solution I found was to change from the Sidekiq logger to the Rails logger, but in your documentation you don't recommend changing this configuration.
The text was updated successfully, but these errors were encountered: