Skip to content

Instantly share code, notes, and snippets.

@binarylogic
Created November 2, 2017 15:20
Show Gist options
  • Save binarylogic/b876108b00505ccdcc813db2dd8623e7 to your computer and use it in GitHub Desktop.
Save binarylogic/b876108b00505ccdcc813db2dd8623e7 to your computer and use it in GitHub Desktop.
Adjusting level temporarily
Rails.logger.level = :info
Rails.logger.silence(Logger::ERROR) do
Rails.logger.info("info message") # will _not_ be logged
Rails.logger.error("error mesasge") # _will_ be logged
end
Rails.logger.info("info message") # _will_ be logged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment