Skip to content

Commit

Permalink
feat: add LogQuietener to example config.ru
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 28, 2018
1 parent 34f44bc commit 2f014f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion example/config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ app = PactBroker::App.new do | config |
# change these from their default values if desired
# config.log_dir = "./log"
# config.auto_migrate_db = true
config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => config.logger))
config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => PactBroker::DB::LogQuietener.new(config.logger)))
end

run app
6 changes: 6 additions & 0 deletions lib/pact_broker/db/log_quietener.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# To reduce the noise of the SQL logs, this class changes INFO
# logs to DEBUG, and changes the ERROR logs that occur when
# Sequel doesn't know if a table/view exists or not to DEBUG,
# so that they don't freak newbies out when they start up the
# broker for the first time.

require 'delegate'

module PactBroker
Expand Down

0 comments on commit 2f014f0

Please sign in to comment.